Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser Support for UTF8 Encoded Characters in URL's

If I navigate to the following URL with a special UTF8 encoded character I get different results in web browsers:

http://example.com/lörickè

  • Firefox 37 - Shows the correct URL as above.
  • Chrome 42 - Shows the correct URL as above.
  • Edge - Shows the correct URL as above.
  • IE 11 - Shows percent encoded URL http://example.com/l%c3%b6rick%c3%a8/

Where can I find a list of browsers and versions that support this feature and are there any announcements of whether the new Microsoft Edge browser supports this.

This StackOverflow post highlights the above issue for those interested.

like image 995
Muhammad Rehan Saeed Avatar asked May 01 '15 13:05

Muhammad Rehan Saeed


1 Answers

What is shown in browser address bars is not necessarily what is used internally.

If you enter http://example.com/lörickè in Firefox, it gets shown like that, but it actually gets percent-encoded and becomes http://example.com/l%C3%B6rick%C3%A8. This is for usability reasons (or, if IRIs are not supported, like in HTTP/1.1, for transforming an IRI into a URI), so users don’t necessarily have to enter the correct URL (with percent-encoding), and don’t get confused by seeing these cryptic parts.

You can easily check what really gets used by copy-pasting the URL from the address bar into a text document.

So the three browsers from your example probably use the same URI (i.e., percent-encoded), but two browsers decided to display the un-encoded variant instead.

like image 93
unor Avatar answered Oct 16 '22 16:10

unor