encodeURI 编码、decodeURI 解码
2013-11-18 15:04
211 查看
[align=center]encodeURI 编码、decodeURI 解码[/align] |
encodeURI和decodeURI 主要用于URL(网址)的编码、解码,是JavaScript的自身函数,采用UTF-8编码格式对指定的字符串进行编码或解码。 编码函数 encodeURI():将非字母、数字 字符转换成ASCII码,以16进制表示 译码函数 decodeURI():将被encodeURI()编码过的 ASCII码转换成对应的字符 例如:空格符号 对应的编码是 %20 |
[align=center] 周明明 [/align] |
说明: |
本项功能只是用于 encodeURI编码和decodeURI解码 的对照,可以识别和研究网址<URL地址>中被编码过的汉字。 encodeURI函数不能编码的字符:@ ~ ! @ # $ & * ( ) _ + : ? - = ; ' , . / 英文 数字 由于目前各国网页字符集的不同造成了URL编码的多种形式,例如 GBK和UTF 这2种字符集的网页中汉字URL编码方式就不一样。 encodeURI编码和decodeURI解码只能针对UTF-8字符集的网页,不能识别GBK网页编码过的汉字编码。 |
[align=center]------------------------------[/align] |
[align=center]encodeURIComponent 编码、decodeURIComponent 解码[/align] |
encodeURIComponent和decodeURIComponent 主要用于URL(网址)的编码、解码,是JavaScript的自身函数,采用UTF-8编码格式对指定的字符串进行编码或解码。 编码函数 encodeURIComponent():将非字母、数字 字符转换成ASCII码,以16进制表示 译码函数 decodeURIComponent():将被encodeURIComponent()编码过的 ASCII码转换成对应的字符 例如:空格符号 对应的编码是 %20 |
[align=center] 请复制需要编码或解码的字符到这里! [/align] |
说明: |
本项功能只是用于 encodeURIComponent编码和decodeURIComponent解码 的对照,可以识别和研究网址<URL地址>中被编码过的汉字。 encodeURIComponent函数相对于encodeURI函数来说,可以对更多的字符进行编码, 包括:@ # $ & + : ? = ; , / 等字符。 encodeURIComponent函数不能编码的字符:@ ~ ! * ( ) _ - ' . 英文 数字 由于目前各国网页字符集的不同造成了URL编码的多种形式,例如 GBK和UTF 这2种字符集的网页中汉字URL编码方式就不一样。 encodeURIComponent编码和decodeURIComponent解码只能针对UTF-8字符集的网页,不能识别GBK网页编码过的汉字编码。 |
相关文章推荐
- decodeURI解码,由URIEncoder.encode("","GBK")编码的中文,问题解决
- encodeURIComponent编码 URLDecoder.decode解码乱码的问题
- decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。
- JS中encodeURIComponent(URL)编码与decodeURIComponent(URL)解码详解
- encodeURI 编码、decodeURI 解码
- encodeURIComponent编码 URLDecoder.decode解码乱码的问题
- JS中encodeURIComponent(URL)编码与decodeURIComponent(URL)解码详解
- js中的编码解码--escape/unescape、encodeURI/decodeURI 、encodeURIComponent/decodeURIComponent
- JS----编码,解码decodeURIComponent,encodeURIComponent,decodeURI,encodeURI
- %25%37%DD 。。。上述形式不是乱码。 这是urlencoding。 你可以使用js内置的方法 encodeURIComponent进行编码, 而使用decodeURIComponent把上述形式再解码为普通字符
- encodeURIComponent编码 URLDecoder.decode解码乱码的问题
- 一张图看懂encodeURI、encodeURIComponent、decodeURI、decodeURIComponent的区别 一、这四个方法的用处 1、用来编码和解码URI的 统一资源标识符
- encodeURIComponent()编码和decodeURIComponent()解码
- encodeURIComponent编码后java后台的解码
- BASE64编码与解码(Base64Encode,Base64Decode)
- 8.python中字符串的编码和解码问题——decode/encode
- java中的URLEncoder.encode对应JS中用decodeURIComponent,js和java编码,解码
- js 中编码(encode)和解码(decode)的三种方法
- JS的 escape、encodeURI 、encodeURIComponent 编码与解码
- encodeURIComponent编码后java后台的解码