查了一下 RFC " /> 久久免费视频这里只有精品,黑人中文字幕一区二区三区 ,大桥未久av一区二区三区

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

url decode problem 解決方法

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

查了一下 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.
表示加號(hào)已經(jīng)是url的保留字了,不需要轉(zhuǎn)義。

然后html4文檔里才有關(guān)于加號(hào)的轉(zhuǎn)義:

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時(shí)才會(huì)對+做轉(zhuǎn)義。

又翻了下php的文檔,發(fā)現(xiàn)有一個(gè)

rawurlencode() - URL-encode according to RFC 3986


也就是php又搞了rawurlencode和rawurldecode把標(biāo)準(zhǔn)實(shí)現(xiàn)了。。。。

不能反一下么,畢竟大部分人應(yīng)該都會(huì)用urlencode。php真是蛋疼啊。。。。

php技術(shù)url decode problem 解決方法,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 宿州市| 盈江县| 峨眉山市| 黔东| 襄城县| 南漳县| 盖州市| 叙永县| 贵德县| 黑山县| 漳浦县| 宾阳县| 从化市| 高要市| 屏南县| 遂溪县| 高安市| 连山| 花莲县| 广南县| 怀远县| 闻喜县| 乐山市| 杭州市| 罗田县| 祁连县| 凉山| 定襄县| 泰州市| 贵溪市| 锦屏县| 台湾省| 游戏| 东港市| 房产| 淳安县| 泾源县| 济南市| 焉耆| 若羌县| 延长县|