The Artima Developer Community
Sponsored Link

Java Answers Forum
How do I convert a file to a unicode encoding??

2 replies on 1 page. Most recent reply: Sep 25, 2003 12:01 PM by abeselom

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
abeselom

Posts: 4
Nickname: abeselom
Registered: Sep, 2003

How do I convert a file to a unicode encoding?? Posted: Sep 23, 2003 12:38 PM
Reply to this message Reply
Advertisement
I am reading an XML file as a ByteArray and I am getting the exception below.

javax.xml.transform.TransformerException: An invalid XML character (Unicode: 0xfa) was found in the element content of the document.

I tried converting the xml file I am reading to unicode as below, but
that didn't work.

new String (byteArray, "UTF8").getBytes();

This is part of the xml file generating the exception and I am not sure where this character •ö is coming from.

<BILLTEXT id="3"><FONT id="1E">Helvetica,bold,08,italic</FONT><DBTEXT>S•öDBTEXT>< /BILLTEXT>

I really appreciate your help.

Thanks!!!!!!!!!!
Abeslom


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: How do I convert a file to a unicode encoding?? Posted: Sep 24, 2003 3:30 AM
Reply to this message Reply
correct encoding is often ISO-8859-1 for some european lang...

abeselom

Posts: 4
Nickname: abeselom
Registered: Sep, 2003

Re: How do I convert a file to a unicode encoding?? Posted: Sep 25, 2003 12:01 PM
Reply to this message Reply
I have also tried using ISO-8859-1 and that didn't work either.

Thanks!!

Flat View: This topic has 2 replies on 1 page
Topic: Network question Previous Topic   Next Topic Topic: HELP! needed on DTD for struts-config.xml file

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use