I’m developing an international site which uses UTF8 to display non english characters. I’m also using friendly URLS which contain the item name. Obviously I can’t use the non english characters in the URL.
Is there some sort of common practice for this conversion? I’m not sure which english characters i should be replacing them with. Some are quite obvious (like è to e) but other characters I am not familiar with (such as ß).
I normally use iconv() with the ‘ASCII//TRANSLIT’ option. This takes input like:
and produces output like:
Then I use preg_replace() to replace white spaces with dashes:
… and remove unwanted chars, e.g.
It’s probably useless with Arabic or Chinese but it works fine with Spanish, French or German.