Bugs item #1003141, was opened at 2004-08-04 17:50 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1003141&group_id=16035
Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Zhang Tao (robintj) Assigned to: Nobody/Anonymous (nobody) Summary: SAXReader.read(File file) character encoding problem Initial Comment: In the SAXReader.read(File file) function, the code is: return read( new InputSource(new FileReader(file)) ); But the FileReader Class says: Convenience class for reading character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are appropriate. To specify these values yourself, construct an InputStreamReader on a FileInputStream. FileReader is meant for reading streams of characters. For reading streams of raw bytes, consider using a FileInputStream. It means FileReader only use the "default character encoding". And when I program use this code: File f = new File(fname); SAXReader reader = new SAXReader(); Document doc = reader.read(f); It cannot read correct Chinese character from XML File that uses UTF-8 encoding (and my system default character encoding is zh_CN.GBK). But if I change the code to: Document doc = reader.read(new FileInputStream(f)); All is OK. So I advice SAXReader.read(File file) function changed to: return read( new InputSource(new FileInputStream(file)) ); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1003141&group_id=16035 ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ dom4j-dev mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-dev