URL为什么使用百分号编码(URL编码)
1、一些数据(二进制串)无法在URL中使用字符表示(以US-ASCII字符集举例,其中的一些 字符 并不能显示的表示出来,如响铃)
2、传输的字符是URL中保留的字符(如URL解析时使用 / 作为分隔符)
3、不安全的字符(这个是由于不同的文本处理程序对于文本可能会有不同的规则,如为了防止无用的空格输入,我们在写程序的时候可能会去掉文本的前后空格)
1)rfc文档 : https://www.rfc-editor.org/rfc/rfc1738
No corresponding graphic US-ASCII
URLs are written only with the graphic printable characters of theUS-ASCII coded character set. The octets 80-FF hexadecimal are notused in US-ASCII, and the octets 00-1F and 7F hexadecimal representcontrol characters; these must be encoded.Unsafe:
Characters can be unsafe for a number of reasons. The spacecharacter is unsafe because significant spaces may disappear andinsignificant spaces may be introduced when URLs are transcribed ortypeset or subjected to the treatment of word-processing programs.The characters