How do I display non-English characters OK on our Web site?

Hello,

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?

Thanks,

You use a html code number or name for the characters.
Eg, Ü = &#220;
ß = &#223;
ä = &#228;
For reference.

1 Like

Hi there WorldNews,

use this

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

…with this dtd…

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
…and this…

<meta charset="utf-8">

…with this dtd…

<!DOCTYPE html>

The documents must be saved with UTF-8 encoding, preferably without BOM. :smiley: .

coothead

1 Like

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)

Beaten to the punch by coothead. :slight_smile:

1 Like

Good point coothead, the fake xhtml 1.0 (the doctype lacks xml parts) is really html 4.01.

Seems like he already tried that?

That was an erronous statement. lol

The HTML numbers are corresponding to the UTF-16 character set! You can easily check that in any character map software bundled with your OS.

Could always check facts before posting but what’s the fun in that?

Hi,

I tried both of these. But both still resulted in German Chars not showing.
Which you can see for yourself by going to:

SamA74,
They are displayed, stored and then displayed, as regular German Chars, that is such as:
ß

Erik,
Both Web sites are created and saved by the same Editor that is EditPlus
and uploaded to server with same WinSCP!

But pages under anoox display German Chars OK, however pages under WasTopia do not!
As you can see:

vs

https://www.anoox.com/ask_answer/qanda.php?q_id=1348901

Hi there WorldNews,

I cannot comment on your page, but this…

[code]

German characters body { font-family:arial,helvetica,sans-serif; font-size:100%; }

ä Ä ö Ö ü Ü ß €

[/code]

…works OK for me. :sunglasses:

I copied and pasted the characters from this site…

http://german.typeit.org/

…and saved the file as I suggested in post #3. :smile:

coothead

They are both served as utf-8 as I checked now.

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.

Edit; Hi coothead you got me again. :slight_smile:

I am extremely sorry about that Eric. :cry:

But I did wait nearly 3 hours for you to make a reply to WorldNews’s last post. :smile:

I then assumed, incorrectly as it turned out, that you had gone off for a beer,
so I just popped in with my little reply. :imp:

coothead

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:

AddCharset UTF-8 .html

And save.

1 Like

Hi Michael, But if the page originally was saved as iso-8859-1 then if server sends it as utf-8 it doesn’t recode the page, or does it?

Off topic:
I’m constantly AFK, in the middle of posting, all the time. :slight_smile:

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.

Michael_Morris,

I added the “AddCharset UTF-8 .html”

to the .htaccess and it is still not displaying German Chars Ok, as you can see:

Ayayayaya!
Why something so basic should be so difficult! Time wasting :frowning:

coothead, I tried your Code too.
And still it displays German chars as Gobbly gook!

Erik_J,

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?