Is there any way to avoid showing “xn--” for IDN domains?

馋奶兔 提交于 2021-02-20 19:00:00

问题


If I use a domain such as www.äöü.com, is there any way to avoid it being displayed as www.xn--4ca0bs.com in users’ browsers?

Domains such as www.xn--4ca0bs.com cause a lot of confusion with average internet users, I guess.


回答1:


This is entirely up to the browser. In fact, IDNs are pretty much a browser-only technology. Domain names cannot contain non-ASCII characters, so the actual domain name is always the Punycode encoded xn--... form. It's up to the browser to prettify this, but many choose to not do so to avoid domain name spoofing using lookalike Unicode characters.




回答2:


From a security perspective, Unicode domains can be problematic because many Unicode characters are difficult to distinguish from common ASCII characters (or indeed other Unicode characters).

It is possible to register domains such as "xn–pple-43d.com", which is equivalent to "аpple.com". It may not be obvious at first glance, but "аpple.com" uses the Cyrillic "а" (U+0430) rather than the ASCII "a" (U+0061). This is known as a homograph attack.

Fortunately modern browsers have mechanisms in place to limit IDN homograph attacks. The page IDN Policy on chrome highlights the conditions under which an IDN is displayed in its native Unicode form. Generally speaking, the Unicode form will be hidden if a domain label contains characters from multiple different languages. The "аpple.com" domain as described above will appear in its Punycode form as "xn–pple-43d.com" to limit confusion with the real "apple.com".

For more information see this blog post by Xudong Zheng.




回答3:


Internet Explorer 8.0 on Windows 7 displays your UTF-8 domain just fine. Google Chrome 19 on the other hand doesn't.

Read more here: An Introduction to Multilingual Web Addresses #phishing.

Different browsers to things differently, possibly because some use the system codepage/locale/encoding/wtvr. And others use their own settings, or a list of allowed characters.

Read that article carefully, it explains how each browser works when making a decision. If you are targeting a specific language, you can get away with it and make it work.



来源:https://stackoverflow.com/questions/11008602/is-there-any-way-to-avoid-showing-xn-for-idn-domains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!