Re: XmlDocument and utf-8
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: Mon, 18 Jun 2007 05:27:47 -0700
On Jun 18, 3:29 am, stch...@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
wrote:
Yes, both "UTF-8" and "utf-8" is ok for the charset in XML declaration
section. And the .net framework XmlDocument just always convert the charset
value to lower case for consistency purpose.
In addition, the <?xml ....?> declaration's charset value is only a
suggestion value for some XML processing programs, the actual
charset/encoding format of a XML document/file still rely on how you write
out the document(through file I/O api). In other words, the actual
charset/encoding of a XML file may be different from the charset
declaration in the <?xml ....?> section
It's not really a "suggestion" - it's the encoding which should be
used to parse the rest of the document. If you claim (in the
declaration) to use UTF-8 and actually use some other encoding, XML
parsers are almost certainly going to fail to understand the data in
the way you expect.
Jon
.
- References:
- XmlDocument and utf-8
- From: MaxMax
- Re: XmlDocument and utf-8
- From: Stephany Young
- Re: XmlDocument and utf-8
- From: Steven Cheng[MSFT]
- XmlDocument and utf-8
- Prev by Date: Re: invalid information in http://www.yoda.arachsys.com ?
- Next by Date: Re: Obtaining exclusive access to file / file lock
- Previous by thread: Re: XmlDocument and utf-8
- Next by thread: build article & News Manager
- Index(es):
Relevant Pages
|