How to avoid inconsistent use of German umlauts?

On page 1 there is the following headline:

## München

which results in

<h2 id="münchen"></h2>

On page 2 there is the following cross reference:

[Learn more about München](/page-1#münchen)

which results in

<a href="/page-1#m%C3%BCnchen">Learn more about München</a>

Wouldn’t it be more consistent to use the following?

<a href="/page-1#münchen">Learn more about München</a>

It’s not inconsistent. Depending on the browser %C3%BC is a ü. You can see that sometimes if the HTML has encoded umlauts in a title attribute, but if you hover over the link it is displayed with an ü.

Those are exchange-able in that case, some browsers transform them, some leave them as is.

What is happening is probably that some of the attributes are not encoded and the others are. Have a look at safeHTMLAttr for this:

I am not a fan of umlauts in attributes (like ID or links) so I exchange them manually oftencases. You could do that by:

## München {#muenchen}

Probably also setting the Content-Type to UTF8 instead of Iso 8859-1 might help. But that is a shot in the dark.

UTF-8 is always king for all languages, IMHO. Unless you really need more bytes, for example for Klingon, which is not part of UTF-8.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.