Fil, I would change "should advertise" to "must advertise"! Chances are that
your default apache configurations default to iso-whatever or ascii!

I serve all pages, scripts, xml, and of course html as utf-8.

only html and dynamically generated pages have the ability to slip in a
content-type.

AddDefaultCharset UTF-8

tells everybody that your pages are utf (unless otherwise overridden)
æ,ø, and å.

-- UTF is the only way to go!
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


On 2/5/07, Fil <[EMAIL PROTECTED]> wrote:

@ Jon Ege Ronnenberg <[EMAIL PROTECTED]> :
> I bow for you. You're absolutely right and utf8_decode() was just what I
> needed! Still I don't get why setting charset to UTF-8 doesn't show the
> danish characters correct in a web page then.

It's not something obvious; I wrote an entire article explaining this (but
it's in French) at http://www.uzine.net/article1785.html

in short if your page uses utf-8, it should advertise it in the server
response headers (e.g., in php:
        header('Content-Type: text/html; charset=utf-8');
) and/or as a meta http-equiv inside the <head> of your html page:
        <meta http-equiv="Content-Type" content="text/html;
charset=utf-8">

This is because for most browsers the default charset for web pages (when
they don't advertise which charset they use) is iso-latin. In that case
your
danish characters (encoded on two bytes, b1, b2) will look as two
iso-latin
characters ("b1" then "b2", which is displayed on screen like "�^@")
instead
of one two-byte character ("b1b2", displayed as you want it to be).

hope this helps

-- Fil


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to