473,324 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

IE DOM encoding

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
4 3172
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

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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Christopher H. Laco | last post by:
Long story longer. I need to get web user input into a backend system that a) only grocks single byte encoding, b) expectes the data transer to be 1 bytes = 1 character, and c) uses the HP Roman-6...
8
by: davisjoseph | last post by:
Hi All, I'm newbie to this XML world. My problem is to identify the encoding type of XML at runtime. What currently I'm doing is checking whether BOM is available in the XML; based on the BOM...
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
4
by: fitsch | last post by:
Hi, I am trying to write a generic RSS/Atom/OPML feed client. The problem is, that those xml feeds may have different encodings: - <?xml version="1.0" encoding="ISO-8859-1" ?>... - <?xml...
2
by: velle | last post by:
My headache is growing while playing arround with unicode in Python, please help this novice. I have chosen to divide my problem into a few questions. Python 2.3.4 (#1, Feb 2 2005, 12:11:53) ...
0
by: Chris McDonough | last post by:
ElementTree's XML serialization routine implied by tree._write(file, node, encoding, namespaces looks like this (elided): def _write(self, file, node, encoding, namespaces): # write XML to file...
4
by: Bob | last post by:
Hi Need to produce a Doc with no encoding info. Is there anyway of doing this? Thanks Bob i.e. <?xml version=\"1.0\" ?>
4
by: Christina | last post by:
Hey Guys, Currently, I am using the below code: Dim oReqDoc as XmlDocument Dim requiredBytes As Byte() requiredBytes = System.Text.UTF8Encoding.UTF8.GetBytes(oReqDoc.InnerXml). Here, I am...
3
by: mortb | last post by:
1. How do I determine which encoding a xmldocument or xmlreader uses when opening a document? I'm not just talking about the <?xml encoding="utf-8"?attribute, but the actual encoding of the...
1
by: ujjwaltrivedi | last post by:
Hey guys, Can anyone tell me how to create a text file with Unicode Encoding. In am using FileStream Finalfile = new FileStream("finalfile.txt", FileMode.Append, FileAccess.Write); ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.