Ravi, I attached the test.xml here, if you can't get it for any reason, please download it through the archive: http://marc.theaimsgroup.com/?l=xerces-j-user&r=1&w=2
Thanks, Benson. -----Original Message----- From: Ravi Varanasi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2003 10:49 AM To: [EMAIL PROTECTED] Subject: RE: UTF-16 encoding problem Benson, The XML fies I have are UTF-8 encoded. So, I can't test. If you could send UTF-16 encoded XML file, I will change my pgm & test it. Thanks, Ravi Varanasi 408 517 7675 (Work) 408 394 3273 (Mobile) |---------+----------------------------> | | "Benson Cheng" | | | <[EMAIL PROTECTED]| | | core.net> | | | | | | 09/30/2003 10:21 | | | AM | | | Please respond to| | | xerces-j-user | | | | |---------+----------------------------> >----------------------------------------------------------------------- ----------------------------------------------------------------------| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: RE: UTF-16 encoding problem | >----------------------------------------------------------------------- ----------------------------------------------------------------------| Hi Ravi, The problem only happens to UTF-16 encoding, I am pretty sure my input file (attached) is a valid UTF-16 XML. I think this problem can be reproduced on any UTF-16 XML, do you want try modify your code to UTF-16 and try out? Thanks, Benson. -----Original Message----- From: Ravi Varanasi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2003 10:05 AM To: [EMAIL PROTECTED] Subject: RE: UTF-16 encoding problem Hi, I do not see anything wrong in your code. I have the following piece of code in my program, working perfectly fine since last couple months. I am using UTF-8 though. I do NOT think the change in encoding will make any difference, provided your file is in the format given in setEncoding method. What I suspect is, your input file is not UTF-16 encoded but, you are setting the stream encoding as UTF-16. Check it out & let us know if that fixes the problem. I use UniPad UTF editor to check encoding. try { InputSource ipSource = new InputSource(); ipSource.setEncoding("UTF-8"); ipSource.setByteStream( new FileInputStream( new File(inputFile) ) ); parser.parse(ipSource); return true; } catch (SAXParseException e) { e.printStackTrace(); return false; } catch (Exception e) { e.printStackTrace(); return false; } Thanks, Ravi Varanasi 408 517 7675 (Work) 408 394 3273 (Mobile) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] (See attached file: test.xml) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
��<