I have a Reports.war file. This war file reads a csv file on the filesystem and generates an xml file(saved onto the filesystem) from it.
Scenario in windows The generated xml file displays the accented/tildes on the spanish characters correctly.
eg: <field name="alert_master_id">TESTSIVA19Inter Téléfónícá</field>
Scenario in Unix
The generated xml file displays the accented/tildes on the spanish characters incorrectly.
eg:<field name="alert_master_id">TESTSIVA19Inter T?l?f?n?c?</field>
Note: Its the same war with the same csv file. It produces 2 different results.
That just shows what encoding is specified in the XML file. The more important question is: are you actually using that encoding for generating the file? If you're not explicitly specifying an encoding, then the platform default encoding is used - which on Unix is probably not ISO-8859-1.
The next question is: where are you seeing those question marks? Is it somewhere where you can be sure that accented characters would be displayed correctly?
Ulf Dittmer wrote:That just shows what encoding is specified in the XML file. The more important question is: are you actually using that encoding for generating the file? If you're not explicitly specifying an encoding, then the platform default encoding is used - which on Unix is probably not ISO-8859-1.
Actually, at least for Linux, I'm fairly sure that the encoding is ISO-8859-1. It's Windows I'm less certain of. Windows likes Windows-1252, which I think grew out of the IBM 8-bit ASCIIZ extension to the original 7-bit ASCII code.
A lot of XML tools prefer you use UTF-8 to encode the XML, however.
That just shows what encoding is specified in the XML file. The more important question is: are you actually using that encoding for generating the file? If you're not explicitly specifying an encoding, then the platform default encoding is used - which on Unix is probably not ISO-8859-1.
Thats for this point. The code did not explicitly set an encoding hence it picked up the encoding set at the os level. In case of unix it was set to C(thus explaining why it was not working on the unix system).The windows system had the encoding set to Latin-1 (which was what I needed).
I modified the code to explicitly set the encoding and voila! it worked .
Thanks so much.
Post by:autobot
Dinner will be steamed monkey heads with a side of tiny ads.
a bit of art, as a gift, the permaculture playing cards