This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: utf-16 encoding
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] utf-16 encoding
- From: "Julian F. Reschke" <julian dot reschke at gmx dot de>
- Date: Fri, 29 Dec 2000 09:44:14 +0100
- Cc: <GarethS at tisi dot com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Kevin
> McCarthy
> Sent: Friday, December 29, 2000 3:42 AM
> To: xsl-list@lists.mulberrytech.com
> Cc: GarethS@tisi.com
> Subject: Re: [xsl] utf-16 encoding
>
>
> Gareth,
> The only thing I've discovered is to open the xml file in question as text
> string using the filesystem object, and do a replace on the <?xml>
> processing instruction (or whatever it's called). It seems like any
> xmlDOM.Save(l_szFilePath) using msxml results in the encoding you've
> described.
>
> -Kevin
MSXML's DOM (ab)uses a Processing Instruction node holding the XML
declaration to remember which encoding to use when serializing the DOM using
the "save" method (you can even use that to modify the initial value read
during "read").
However, serializing to a string using the "xml" method *always* give you an
UTF-16 encoded string, as it is a 16 bit DCOM BSTR. Vice versa, "loadXML"
*only* takes a UTF-16 encoded string, and will generate an error when an XML
declaration with encoding != UTF-16 is present.
Julian
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list