Forum Moderators: open

Message Too Old, No Replies

German special characters in URLs?

What is the best policy?

         

Bobby_Davro

4:24 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



I am not very familiar with the use of non-English (Latin) character sets on the web, so I am a bit confused. I have read a number of threads on WWW about this, but none seem to cover this topic exactly.

It appears that I can approach this in one of two ways -

1. Build the file name using the actual word, like this:
fußball.html
and then reference the page in links using:
fu%afball.html

2. Encode the file name directly:
fu%DFball.html
and then use this as the address.

Any help would be appreciated. I prefer the first one, since this will let me just build the pages using the actual German word.

I am a little confused as to why the URL encoding uses a different translation set as well.

nafmo

4:37 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



The best approach is to avoid using non-ASCII characters in the URL altogether. Stick to lowercase a-z and numbers, and you'll be much safer.

Anyway, if you write a URL with non-ASCII characters (such as ß) in the address field, most current browsers (MSIE 5+, Opera 6+, most likely Mozilla too, haven't checked) will send it UTF-8 encoded and %-escaped to your server, something your server must have provisions for. If you instead prefer to have URLs that already contain %-escapes, you need to make sure that teh file names on your server are what your server would expect when encountering such a URL. What this is will vary between server brands and versions.

Having a link in a HTML page with non-ASCII characters is most likely incorrect (although there are different opinions on this), and is anyway most confusing (should the URL be sent as UTF-8, the document encoding or the browser's encoding?). As above, most browsers will default to UTF-8 here as well, but it may vary depending on browser settings.

tschild

4:58 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



Using non-ASCII chars in URLs is just a recipe for having link breaks somewhere down the line.

If you want your URLs to be meaningful words just use the following convention that all Germans are familiar with:

ä -> ae
Ä -> Ae
ö -> oe
Ö -> Oe
ü -> ue
Ü -> Ue
ß -> ss

Bobby_Davro

5:57 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



That's great, thank you (both of you). I will go with the translation idea, since that will fit into my model most easily I think. I don't want to start guessing what to use for different browsers etc.

g1smd

12:25 am on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What about punicode that allows all sorts of non-Latin charcters in domain names, Chinese, Arabic, and so on?

Any thoughts?

Paco

8:22 am on Oct 29, 2003 (gmt 0)

10+ Year Member



I would stay away from any strange characters just to be safe. You never know what a browser or email agent will do with them. For me, safe characters are a-z, 0-9, - and _.

Almost nobody looks at urls so if they are meaninful to you they should be ok.

As an example I replace "ñ" with "ny" in urls.