Unicode URL Encoding in XTML UTF-8 Documents

I would like to include a URI http://beispiel.de/schnäppchenin a link in an XHTML document that is encoded in UTF-8.

Do I have to percentage encode the url and write

<a href="http://beispiel.de/schn%C3%A4ppchen">foobar</a>

? "ä" is a legal symbol in UTF-8 and therefore must be legal in XML / XHTML, no?

+3
source share
1 answer

Right in (X) HTML, but not legal in rfc2396 url.

Note that characters are converted using URL% -encoding, and not as SGML entities (c &)

+3
source

Source: https://habr.com/ru/post/1734037/


All Articles