首页  »   移动开发

URL非一般字符转义

网友分享于:2013-11-09  浏览:20次
URL特殊字符转义


URL中一些字符的特殊含义,基本编码规则如下:

1、空格换成加号(+)
2、正斜杠(/)分隔目录和子目录

3、问号(?)分隔URL和查询
4、百分号(%)制定特殊字符
5、#号指定书签
6、&号分隔参数

如果需要在URL中用到,需要将这些特殊字符换成相应的十六进制的值

字符                                   URL编码值

空格                                     %20

"                                         %22

#                                        %23

%                                        %25

&                                         %26

(                                         %28

)                                         %29


+                                          %2B

,                                          %2C

/                                          %2F

:                                          %3A

;                                          %3B

<                                          %3C

=                                          %3D

>                                          %3E

?                                         %3F

@                                         %4o

\                                           %5C


|                                           %7C

相关解决方案

最新解决方案