规范标签和UTF8

发布于 2024-10-04 03:27:29 字数 240 浏览 10 评论 0原文

以下 2 个规范链接标签会被蜘蛛视为指向同一个 URL 吗?

- 编码
- 未编码

Would the following 2 canonical link tags be viewed by spiders as pointing to the same URL?

<link rel="canonical" href="http://www.example.com/ŷ" /> - encoded
<link rel="canonical" href="http://www.example.com/ŷ" /> - unencoded

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

余生再见 2024-10-11 03:27:29

ŷ 是一个 HTML 实体,以十进制表示法表示代码点为 375 的 Unicode 字符。在十六进制中它是 0x177,所以我们讨论的是 U+0177,即 ŷ

这意味着两个 URL 完全相同,如果:

  1. 它们显示在 HTML 文档的上下文中。
  2. 该文档声明了支持此类符号的正确字符集,并且用于键入它的编辑器插入了正确的代码。

如果浏览器在这两种情况下都显示 ŷ,则字符集可能是正确的,但您应该确保它是正确的。

ŷ is an HTML entity that represents the Unicode character with code point 375 in decimal notation. In hexadecimal it'd be 0x177 so we are talking about U+0177 which is ŷ.

That means that both URLs are exactly the same if:

  1. They're displayed in the context of an HTML document.
  2. The document declares a proper character set that supports such symbol and the editor you used to type it inserted the right code.

If the browser displays ŷ in both cases it's likely that character set is correct but you should make sure it is.

赠意 2024-10-11 03:27:29

如果您将 HTML 作为 UTF-8 进行通信,则 url 会被视为相同。

if you communicate your HTML as UTF-8 the url is seen as the same.

多孤肩上扛 2024-10-11 03:27:29

不是 100% 确定,但我认为它们都指向相同的 URL。但请记住,查看 W3 标准时,他们经常建议对链接进行编码。

Not 100% sure, but I think they both would point to the same URL. But keep in mind, that looking at W3 standards, they often suggest links to be encoded.

や三分注定 2024-10-11 03:27:29

尽管您可以期望它在现代浏览器中工作,http://www.example.com/ŷ 是一个无效的 URL

您应该始终对 unicode 字符进行百分比编码。

Even though you can expect it to work in modern browsers, http://www.example.com/ŷ is an invalid URL.

You should always percent encode unicode characters.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文