从未见过,也无法在URL中找到这样一个奇怪的符号编码

时间:2015-04-07 11:08:29

标签: unicode url-encoding

有人曾在网址中看到过这样的符号编码:&%23x3F;吗?

它似乎就像编码',但它看起来更像是来自Word的撇号。 '看起来像%27%E2%80%98%E2%80%99。你可以看到它here

问题是:这究竟是什么标志?我无法在任何unicode表中找到它!我先想到,它可能是一个组合

1 个答案:

答案 0 :(得分:1)

%23#字符的网址编码形式。因此,URL包含编码的字符串值?

HTML实体可以用以下三种格式之一表示:

&<name>; &#<decimal>; &#x<hex>;

在这种情况下,URL包含十六进制编码的HTML实体,其中0x3F?字符的十六进制值。

<强>更新

您提供的网址:

http://ow.ly/LhPyt

此网址直接:

http://www.hotelreservierung.de/angebot/St-James's-Club-Morgan-Bay-Saint-Lucia/Hotel-4432957

两者都通过HTTP重定向响应此URL:

http://www.hotelreservierung.de/angebot/St-James&%23x3F;s-Club-Morgan-Bay-Saint-Lucia/Hotel-4432957

GET /8vb7n8 HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
DNT: 1
Host: goo.gl
Connection: Keep-Alive

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Date: Fri, 10 Apr 2015 16:59:34 GMT
Location: http://www.hotelreservierung.de/angebot/St-James&%23x3F;s-Club-Morgan-Bay-Saint-Lucia/Hotel-4432957
Content-Encoding: gzip
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 240
Server: GSE
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Age: 83
Alternate-Protocol: 80:quic,p=0.5

GET /angebot/St-James's-Club-Morgan-Bay-Saint-Lucia/Hotel-4432957 HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Host: www.hotelreservierung.de
DNT: 1
Connection: Keep-Alive

HTTP/1.1 301 Moved Permanently
Date: Fri, 10 Apr 2015 17:01:07 GMT
Server: Apache/2
Provided-Host: hrslave03
Set-Cookie: _hrlnkflghtl2=a%3A1%3A%7Bi%3A0%3Bs%3A12%3A%22Hrlnkflghtl1%22%3B%7D; expires=Sun, 10-May-2015 17:01:07 GMT; path=/
Set-Cookie: _hrhtldtlnwdsgn2=a%3A1%3A%7Bi%3A0%3Bs%3A16%3A%22Hrhtldtlnwdsgn2b%22%3B%7D; expires=Sun, 10-May-2015 17:01:07 GMT; path=/
Set-Cookie: _hrstrtpgnwfrm=a%3A1%3A%7Bi%3A0%3Bs%3A14%3A%22Hrstrtpgnwfrm4%22%3B%7D; expires=Sun, 10-May-2015 17:01:07 GMT; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: mDhBeFyD=00; Expires=Sat, 11-Apr-2015 17:01:07 GMT; Path=/
Location: /angebot/St-James&%23x3F;s-Club-Morgan-Bay-Saint-Lucia/Hotel-4432957
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Connection: close
Content-Type: text/html

注意两个回复中的Location标题。

在第一种情况下,浏览器只是导航到goo.gl告诉它去的新网址。

在第二种情况下,浏览器正在'请求中按原样发送GET个字符,然后重定向到包含&%23x3F;的新网址。因此,hotelreservierung.de服务器本身决定在其URL中将'字符编码为&%23x3F;。这不是浏览器那样做的。