Search code examples
browseridnpunycode

Do browsers encode in punycode only domain or whole url?


I was reading about IDN homograph atack and didn't find exactly stated does browsers encode in punycode only domain or rest of the URL is included (path and query). So my question is does one of popular browsers (FF, IE, Chrome, Safari, Opera) encode rest of the URL (IRI to be exact) with punycode ?


Solution

  • Only the domain name part is encoded with punycode. This is due to the restrictions imposed on the allowable characters in a (traditional) domain name. The path part of the URL has no such restrictions, so UTF-8 is often used.