By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

IE DOM encoding

P: n/a
Hello,
I just needed some help on how the DOM is decoded by the IE
parser.
As per the MSDN page,
http://msdn.microsoft.com/workshop/a...ce/charsets/ch...
,server encodings are considered first,then the <metatag 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 www.baidu.com .There is
no encoding specified in the content-type header on this site .Also,
the preferred encoding is specified in the <metatags 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
above?

Thanks
Provost Zak

Oct 26 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2006-10-26, Provost Zakharov <pr***********@gmail.comwrote:
Hello,
I just needed some help on how the DOM is decoded by the IE
parser.
As per the MSDN page,
http://msdn.microsoft.com/workshop/a...ce/charsets/ch...
,server encodings are considered first,then the <metatag 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 www.baidu.com .There is
no encoding specified in the content-type header on this site .Also,
the preferred encoding is specified in the <metatags 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?
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.
And if the default user encoding is being used to decode the content
,isn't that contradictory to what is specified on the page above?
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.
Oct 26 '06 #2

P: n/a

Ben C wrote:
On 2006-10-26, Provost Zakharov <pr***********@gmail.comwrote:
Hello,
I just needed some help on how the DOM is decoded by the IE
parser.
As per the MSDN page,
http://msdn.microsoft.com/workshop/a...ce/charsets/ch...
,server encodings are considered first,then the <metatag 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 www.baidu.com .There is
no encoding specified in the content-type header on this site .Also,
the preferred encoding is specified in the <metatags 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?

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.
And if the default user encoding is being used to decode the content
,isn't that contradictory to what is specified on the page above?

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.
Hello,
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:
http://msdn.microsoft.com/workshop/a...s/charset4.asp

Any help would be highly appreciated.
Thanks
Provost Zak

Oct 26 '06 #3

P: n/a
Provost Zakharov wrote:
I used Ethereal to packet sniff the traffic to www.baidu.com .There is
no encoding specified in the content-type header on this site .Also,
the preferred encoding is specified in the <metatags as gb2312
.However ie.Document.charset returns the value windows-1252.
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
http://JavaScript.FAQTs.com/
Oct 26 '06 #4

P: n/a

Martin Honnen wrote:
Provost Zakharov wrote:
I used Ethereal to packet sniff the traffic to www.baidu.com .There is
no encoding specified in the content-type header on this site .Also,
the preferred encoding is specified in the <metatags as gb2312
.However ie.Document.charset returns the value windows-1252.

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
http://JavaScript.FAQTs.com/
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.

Rgds
Provost Zak

Oct 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.