Atitit.軟件開發概念(11)--網絡子系統--url編碼 空格問題URLEncoder java js php
including HTML 4.01 section 17.13.4, and also RFC 1866 (which is supercededby the W3C HTML recommendations).
在form的ContextType是[x-www-form-urlencoded]的時候會對form中的鍵/值對進行編碼,空格被轉義成+,其他字符依照[RFC1738]標準處理成%HH的情勢。
作者::老哇的爪子Attilax艾龍,EMAIL:1466519819@qq.com
轉載請注明來源: http://blog.csdn.net/attilax
js對文字進行編碼觸及3個函數:escape,encodeURI,encodeURIComponent,相應3個解碼函數:unescape,decodeURI,decodeURIComponent
escape不編碼字符有69個:*,+,-,.,/,@,_,0⑼,a-z,A-Z
encodeURI不編碼字符有82個:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0⑼,a-z,A-Z
encodeURIComponent不編碼字符有71個:!, ',(,),*,-,.,_,~,0⑼,a-z,A-Z
s = org.tuckey.web.filters.urlrewrite.utils.URLEncoder.encodePathParam("a b", "utf⑻");//a%20%20b
手動replace space to %20
或
收到url解析時使用
URLDecoder.decode("a++b%20c")); //a b c
URL編碼中的空格問題 - 來老師的專欄 - 博客頻道 - CSDN.NET.htm
js解碼函數 escape,encodeURI,encodeURIComponent比較 - xuchanghao的專欄 - 博客頻道 - CSDN.NET.htm
上一篇 《銷售總監》讀書筆記