[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

UTF-8

Michael Kay mike at saxonica.com
Tue Sep 29 18:48:42 PDT 2009


  UTF-8
If the XML document has an encoding declaration (<?xml encoding="...."?>) then you must ensure that the file is actually encoded using this encoding.
 
If the XML document has no encoding declaration, then it should typically be encoded in UTF-8 (though there are other ways of indicating the encoding, for example using byte-order-marks, or in an HTTP header). 
 
The most common cause of encoding problems is when you use an encoding such as iso-8859-1 for your document, but have no encoding declaration on the XML document.
 
If you know the encoding of your document, you can always decode it into a character stream yourself, and then pass the character stream to the XML parser (e.g. in Java in the form of a Reader).
 
Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

 


  _____  

From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Jesus Rodrigues
Sent: 29 September 2009 17:15
To: http://x-query.com/mailman/listinfo/talk
Subject:  UTF-8



Dear,




I needed read a lot of xml and some of this file haven't the attribute encoding="UTF-8". And some xml has too a problem with utf-8 (invalid character like this GA�?S). I haven't control about the xml I just needed read.




Is possible solution this problem using the saxon? For example, setting the encoding dynamically, before the build (newDocumentBuilder().build(stream))?




Regards,




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20090929/160019a2/attachment.htm


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-2011 All Rights Reserved.