IE DOM encoding

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

        I just needed some help on how the DOM is decoded by the IE
As per the MSDN page,
,server encodings are considered first,then the <meta> tag specified
encodings and then finally the user's preferred settings(which is
usually Western-European aka windows-1252).

I used Ethereal to packet sniff the traffic to .There is
no encoding specified in the content-type header  on this site .Also,
the preferred encoding is specified in the <meta> tags as gb2312
.However ie.Document.charset returns the value windows-1252.
My question is this...which encoding is being used by the parser to
actually decode the page to Unicode?Is it the default user encoding or
the <meta>
tag encoding?And if the default user encoding is being used to decode
the content ,isn't that contradictory to what is specified on the page

Provost Zak

Re: IE DOM encoding

Quoted text here. Click to load it

Is the page displaying correctly? If so it must be using the meta tag
encoding, as that page _is_ encoded with GB2312, and would look all
wrong if it were decoded as if it were Windows-1252.

Quoted text here. Click to load it

I don't know. Your link to the MSDN page didn't work for me. It may be
that ie.Document.charset means something else.

Re: IE DOM encoding

Ben C wrote:
Quoted text here. Click to load it

        I think the gb2312 encoding has been used on the page too. The
problem is IE.DOM.charset indicates something else altogether.

Reposting the MSDN link again:

Any help would be highly appreciated.
Provost Zak

Re: IE DOM encoding

Provost Zakharov wrote:

Quoted text here. Click to load it

When I load that URL with IE 6 (6.0.2900.2180) on Windows XP SP 2 it
seems to render the document fine (e.g. displays links with
资 讯网 页贴 吧知 道MP3 图 片更 多 >>
between the image and the text input), shows GB2312 as the encoding in
the view menu and shows gb2312 when entering
javascript: alert(document.charset); void 0
in the location bar. Only the document title displays as gibberish in
the IE window title bar but that is not different with other browsers
(e.g. SeaMonkey).


    Martin Honnen /

Re: IE DOM encoding

Martin Honnen wrote:
Quoted text here. Click to load it

Sorry,my bad.
I hadn't installed the Chinese language packs and it looks like IE was
using the default windows-1252 encoding to decode the HTML response.I
installed the language pack and got the same document.charset values as
Martin.Thanks for the help.

Provost Zak

Site Timeline