views:

53

answers:

2

So... I'm still in unicode hell...

New problem...

On my computer, everything shows perfectly. In all browsers. On a co-workers computer, same story. Everything is good. Even in elinks and w3m on one of my Linux VPS'es all the exotic diacritics of Lithuanian and Latvian, and nordic letters, shows perfectly.

However, I have had a few calls from clients today, that they get the usual unicode humbug combinations... "Ã" and another character and stuff like that.

Any suggestions on what could be wrong?

Technical info:

Classic ASP
All files are stored as UTF-8 incl BOM
All files start with Codepage=65001 page directive
All files set the Content-Type to "text/html; charset=utf-8"
A: 

They don't have the required fonts installed?

Graham Perks
No, they would instead have got empty squares (MSIE) or squares with hexcode inside (FF).
BalusC
As an example, check at bottom of [Wikipedia home page](http://www.wikipedia.org/). For certain exotic languages, you see in FF squares with hexcode inside, this simply means that there are no proper fonts for the characters. The hexcodes represents the Unicode codepoints.
BalusC
Because Chrome, Safari, and Opera don't exist.
DeadMG
@DeadMG: those shows useless empty squares as well like MSIE.
BalusC
+4  A: 

"Ã" and another character and stuff like that.

This is typical for UTF-8 content being displayed as ISO-8859-1.

All files set the Content-Type to "text/html; charset=utf-8"

By <meta> or by Response.AppendHeader()? You really need to add it as real response header. Otherwise you're dependent on the client platform default encoding (MSIE) and/or the best-guess a webbrowser can make (FF). You can verify the response headers using a tool like Firebug.

BalusC
The content-type is set by mime-type setting in IIS. *.asp is registered as "text/html; charset=utf-8". Got this solution as a workaround in another question here
Christian W
Are those also *actually* present in the HTTP response headers? Try uppercase `UTF-8` instead, you never know what clients you need to deal with. Let me know.
BalusC
Actually I now see that for this particular file, the content-type is not set correctly... I can workaround that by setting Response.Contenttype in the file, but why would the mime-setting work for some files and not for others?
Christian W
Sorry, ASP/IIS specifics is beyond my knowledge :) Glad you nailed it down.
BalusC
`<meta>` **is** sufficient to set the charset in all browsers, and can be included to ensure the page still works if saved (stripping it of its Content-Type information). The problem is that if you set a `<meta>` Content-Type *and* have a charset in the real Content-Type header, the header wins out, and some servers may be configured to send a charset in the Content-Type by default. This is a misconfiguration, really, but because it's quite common it's best to always set the HTTP header from your application just in case.
bobince
@bob: That's correct, however I recall cases wherein `<meta>` was plain ignored when served online. And indeed, you'd include it as well to ensure the offline working. I also always include both :)
BalusC