[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Microsoft.XMLDOM UTF-8 Encoding!

Subject: Re: Microsoft.XMLDOM UTF-8 Encoding!
From: "[Tech]" <tech@xxxxxxxxxxx>
Date: Fri, 11 Jul 2003 19:02:43 -0400
microsoft.xmldom
Exact,

The first byte supose to tell the encoding.
Like this UTF-16 => "Unicode byte-order mark [0xFF 0xFE] or [0xFE 0xFF]"

But Microsoft (and lot more) say that XML file generate with ASP and XMLDOM
are UTF-8 by default. (no byte was added to the file...)

So, How tell "Microsoft.XMLDOM" to save my XML file with a true UTF-8
encoding?
It can be IIS setting?

Here my ASP code
=============

' Nothing special...
Set oDom = server.CreateObject("Microsoft.XMLDOM")
  oDom.preserveWhiteSpace = True
  oDom.resolveExternals = false

  Set oRoot = oDom.createElement("root")
  oDom.appendChild oRoot

  Set oEnreg = oDom.createElement("test")

' My string with special car.
' Come from utf-8 web form
  oEnreg.Text = request.form("texte")

  oRoot.appendChild oEnreg
  oRoot.normalize()

  Set oPI = oDom.createProcessingInstruction("xml", "version=""1.0""
encoding=""UTF-8""")
  oDom.insertBefore oPI, oDom.childNodes(0)
  oDom.save Server.MapPath("sauve.xml")
===========

Tx

----- Original Message ----- 
From: "Rob Rohan" <me@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, July 11, 2003 6:29 PM
Subject: Re:  Microsoft.XMLDOM UTF-8 Encoding!


> I am going way out here, so please swat me down if I am wrong. If I
> remember correctly the first byte of a file will tell if it is (really)
> utf-8 or iso-8859-1 encoded. You can say its utf-8 in the declaration,
> but if the file is saved with an editor that is only capable of saving
> in iso-8859-1 format, the first byte of the file will say so (something
> about bit order I believe). What you could be running into is a file
> that truly is iso-8859-1 (or utf-16 etc) encoded saying its utf-8 - and
> whatever process you are using to read the xml file doesn't buy what you
> are saying.
>
> Again, sometimes I confuse my dreams with stuff I actually read so that
> may not be true :).
>
> Try setting the xml file to iso-8859-1 or UTF-16 and see what happens
>
> Cheers,
> Rob
>
> On Fri, 2003-07-11 at 14:22, [Tech] wrote:
> > Hi,
> >
> > I create a valid UTF-8 encoding XML file with "Microsoft.XMLDOM".
> > It's OK when a parse my XML/XSL with ASP.
> >
> > But not if I open the file directly with Mozilla or IE
> >
> > 1. My XML file are OK
> > <?xml version="1.0" encoding="UTF-8"?>
> > <?xml-stylesheet type="text/xsl" href="sauve.xsl"?>
> >
> > 2. My XSL file
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xsl:output method="html" encoding="UTF-8" indent="no"/>
> >
> > 3. And I force the "Content-Type"!
> > <xsl:template match="/">
> >    ...
> > =>>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/>
> >   ...
> >
> > Mozilla say (File info tab) that is "ISO" file but say about
"Content-Type"
> > == >text/html; charset=UTF-8
> >
> > Gorgeous!
> >
> > Tx
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> -- 
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.