0

在我的理解中,默认浏览器使用三个字节/字符对保留字符和
非字母数字字符进行编码:

        `%HH', a percent sign and two hexadecimal    
         digits representing the ASCII code of the character.

因此,在服务器端,可以说 queryString是解码前的查询字符串,并且:

decodedQueryString = URLDecoder.decode(queryString , "Utf-8");

此时表达式的值:

decodedQueryString.length() < queryString.length();

通常应该是真的,对吗?

4

1 回答 1

0

几乎。如果未解码的查询字符串不包含任何转义字符,则长度将相等。我想不出在解码后查询字符串会更长的任何情况。

于 2012-11-17T01:36:59.687 回答