一、escape/unescape
escape:escape 方法返回一个包含 charstring 内容的字符串值(Unicode 格式)。所有空格、标点、 重音符号以及任何其他非 ASCII 字符都用 %xx 编码替换,其中 xx 等于表示该字符的十六进制数
unescape:从用 escape 方法编码的 String 对象中返回已解码的字符串
例外字符: @ * / +
二、encodeURI/decodeURI
encodeURI:方法返回一个已编码的 URI。如果将编码结果传递给 decodeURI,则将返回初始的字符串。encodeURI 不对下列字符进行编码:“:”、“/”、“;”和“?”。请使用 encodeURIComponent 对这些字符进行编码
decodeURI:从用encodeURI方法编码的String对象中返回已解码的字符串
例外字符:! @ # $ & * ( ) = : / ; ? + '
三、encodeURIComponent/decodeURIComponent
encodeURIComponent:encodeURIComponent 方法返回一个已编码的 URI。如果将编码结果传递给decodeURIComponent,则将返回初始的字符串。因为 encodeURIComponent 方法将对所有字符编码
decodeURIComponent:从用encodeURIComponent方法编码的String对象中返回已解码的字符串
例外字符:! * ( ) '