Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting XML to Spreadsheet - Problem with Accented Characters

843834May 14 2007 — edited May 14 2007
I have a program that uses an external program to gathers user account information from Active Directory. The external program is .Net, and I execute it from my Java app, which then collects the XML output and saves it in a String variable. So far so good.

Next it parses the XML and retrieves the values for each field for each user 'record' and stores these values in a String member inside of a class I created called "User".

At the end of the process, the User class data is written to a file in XML format. Still, so far so good. However, using a text editor, any user names that have accented characters in them have an extra space character after the accented character. E.g. accented "e" becomes "e ". At least that is how it appears in the Textpad editor app that I use.

Next I have a class called "XMLToExcel", that creates a spreadsheet using Apache's POI library, reads in the XML records , and writes the values for each field into a cell. Here the name with an accented character gives the message "[Fatal Error] <file name>:2617:23: Invalid byte 1 of 1-byte UTF-8 sequence."

I'm not sure what I can to do fix this, or even where to fix it. I wouldn't mind losing the accented characted and replacing it with an un-accented one.

Any ideas? I can provide code snippets if that would help.


-John Gooch
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2007
Added on May 14 2007
2 comments
194 views