On Fri, 2 Aug 2013, Matthew Carey wrote:
I have written an application that takes an xls file as a template and reads
a csv file and outputs another xls file containing the data and images
referenced in the csv file in rows. It uses the formatting from the template
file.

When my POI using applications jar file is run from the command line a
correctly formatted xls file is generated from an xls file used as a
template with imported utf-8 data generating correctly accented characters
in the result xls file.

I'm minded to blame your CSV reading here. POI works only on Java strings, which are unicode. POI sorts out any encoding parts for you when writing to the binary file format.

When reading from a csv file, you need to turn the bytes into the correct characters if you want to get valid Java strings out. Sounds like you're not doing that right in some cases... Easiest way to be sure is add some debugging that prints out a character at a time the values in one of your accented strings, and ensure they're correct

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to