查了一下 RFC " /> 六月婷婷综合,国产一区二区三区探花,777久久精品

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

url decode problem 解決方法

試驗了一下Python的urllib庫以及js 的 encodeURIComponent 均不會替換。空格encode也是替換成了 '%20' 。Python提供了urllib.quote_plus, urlib.unquote_plus來處理空格->加號,看起來還是比較合理的。

查了一下 RFC 3986: 有下面一段

Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-").
RFC 2396 有下面的一段

The plus "+", dollar "$", and comma "," characters have been added to those in the "reserved" set, since they are treated as reserved within the query component.
表示加號已經是url的保留字了,不需要轉義。

然后html4文檔里才有關于加號的轉義:

application/x-www-form-urlencoded
Forms submitted with this content type must be encoded as follows:
Control names and values are escaped. Space characters are replaced by`+', and then reserved characters.....
聲明只有content-type為application/x-www-form-urlencoded時才會對+做轉義。

又翻了下php的文檔,發(fā)現有一個

rawurlencode() - URL-encode according to RFC 3986


也就是php又搞了rawurlencode和rawurldecode把標準實現了。。。。

不能反一下么,畢竟大部分人應該都會用urlencode。php真是蛋疼啊。。。。

php技術url decode problem 解決方法,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 砀山县| 温州市| 绍兴市| 康保县| 东源县| 柏乡县| 丹凤县| 三亚市| 安泽县| 三原县| 石景山区| 南城县| 徐汇区| 琼海市| 夏河县| 临海市| 历史| 司法| 徐州市| 漠河县| 台州市| 芦溪县| 平昌县| 武冈市| 潢川县| 隆昌县| 沐川县| 龙山县| 陵川县| 涿鹿县| 景谷| 濮阳县| 乌兰县| 遵义市| 寿阳县| 平安县| 屏东市| 青岛市| 平原县| 文安县| 隆尧县|