gpt4 book ai didi

http - 网址中的特殊符号

转载 作者:可可西里 更新时间:2023-11-01 17:10:55 25 4
gpt4 key购买 nike

我刚刚看到 AngelList 的这个 URL - http://✌.com/。它有一个奇怪的符号,它重定向到 https://angel.co/ .任何人都知道这是如何工作的?我认为您不能在 URL 中使用这样的符号。

最佳答案

非 ASCII 符号 (UTF-8) 被转换为 Punycode(见下文),因此 http://✌.com/转换(编码)为 http://xn--7bi.com/ .此域的所有者设置重定向(响应状态为 301 永久移动),因此您登陆到 https://angel.co/ .

Punycode is a encoding syntax by which a Unicode (UTF-8) string ofcharacters can be translated into the basic ASCII-characters permittedin network host names. Punycode is used for internationalized domainnames, in short IDN or IDNA (Internationalizing Domain Names inApplications).

For example, when you would type café.com in your browser, yourbrowser (which is the IDNA-enabled application) first converts thestring to punycode "xn--caf-dma.com", because the character 'é' is notallowed in regular domain names. Punycode domains won't work in olderbrowsers.

(source of quotation and Punycode encoder/decoder)

此转换在 RFC 3490 中进行了描述.

关于http - 网址中的特殊符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15729131/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com