How do we display non-English characters OK on our Web site? Such as German Characters like:
Ü
ß
ä
I have tried both of these: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
& <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
But on this Web page:
The German Umlaut Chars such as ß are not displaying, while at another Web site of ours, these Chars are displaying OK using the Meta: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
as you can see here: https://www.anoox.com/ask_answer/qanda.php?q_id=134890
What is going on?
How do we consistently display non-English characters OK?
Like SamA74 said, you can always use the html decimal code.
Those numbers corresponds to the UTF-8 character set by the way.
The head’s meta tag doesn’t change page encoding, it only tells the client what it should be.
Are you sure your page is saved with the proper encoding, be it iso-8859-1 or utf-8?
Is it uploaded to the server with that same encoding, check the ftp settings in your file transfer software?
If that still doesn’t preserve desired encoding, you can check how it’s sent from the server by a “http header viewer” browser addon.
I prefer utf-8 in my editors. Be aware if you write and save as utf-8 in your editor, check editor settings so you save without adding a Byte Order Mark. (E.g. Windows Notepad does, rather use Windows Wordpad or have Notepad save ANSI instead, that’s almost ISO-8859-1 for common chars)
The http://www.wastopia.com/index.php?lang=DE meta-tag says utf-8 but I don’t think it is, it display char errors but corrects them if I switch my browser to iso-8859-1. If I save your page to disk and load it in the browser it displays char errors, but if I resave it from my editor as utf-8 and reload then it displays correct. Ergo; its html content was not utf-8 when I downloaded the page.
The https://www.anoox.com/ask_answer/qanda.php?q_id=134890 meta-tag says iso-8859-1 but it really is utf-8 (and as it is served as utf-8 the browser reads it as utf-8) but the downloaded copy displays correct only if I change the meta-tag to utf-8.
Seems to me you have an editor that maybe auto detects encoding and you might have different versions of the pages.
Thats my two cents.
Charset tags should be used as a last resort. 'Tis far better to configure the webserver to use the right charset. Apache uses ISO-8859-1 by default, but you can (and should) override this in the .htaccess file. Add this line:
I wouldn’t know - but if it’s being saved under that encoding changing the charset meta tag isn’t going to help - the data has already been lost.
EDIT: The Server directive I gave is the correct way to indicate the encoding type, not embedding it in a meta charset tag. The two approaches tell the browser how to handle the file, they have no effect on the document contents or actual encoding.
I am using the same Editor for both Sites, for both pages, that is
EditPlus
And I see the German Text as that, such as ß in both the copies of the files saved on my PC and on the Server. But somehow when they are served by the Server, they are served as GobblyGook!
In the case of WasTopia pages, but not in case of Anoox pages!
Both are saved and served the same. Then the only different is the meta-tag. WasTopia is utf-8 with char errors, but if I change my browser encoding to iso-8859-1 it shows no errors. Anoox is iso-8859-1 with no errors.
Why not try an ad hoc solution; change the WasTopia meta-tag to iso-8859-1 and see what happens?