2010-12-17 41 views

回答

5

要獲得正常的人類可讀地址%的編碼之一:

QString humanReadable = QUrl::fromPercentEncoded("https://example.com/something%20here.zip"); 

要獲得百分比編碼網址:

QUrl myUrl("https://example.com/something here.zip"); 
QString percentEncoded = myUrl.encoded(); 

欲瞭解更多信息,請務必訪問的QUrl documentation

3

如果使用Java,你會使用類似

String newUrl = "whatever the url is".replace("\%2F", "_"); 

打開http://doc.qt.io/qt-5/qstring.html和滾動到取代的信息。

順便說一句,我不確定反斜槓。如果以上操作不起作用,請在這些參數字符串之前嘗試不同的反斜槓組合。

+0

這些類型的澄清請求需要作爲對原始問題的評論。 – rkg 2010-12-17 07:53:05

+2

雅知道它,但在url中的其他百分比代碼的情況下該怎麼辦。有辦法一般處理它們嗎? – Ashish 2010-12-17 08:11:52

+0

@Ravi,他的問題是,他在哪裏可以找到一張關於用哪個符號代替哪個符號的表格,就像%2E和其他人應該做的一樣?對於anwer而言+1。 – SunnyShah 2010-12-17 08:15:57

相關問題