Forums Register Login

Spanish characters not displayed in xml file in Unix

+Pie Number of slices to send: Send

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.


Any help is deeply appreciated.

Thanks
Sarah
+Pie Number of slices to send: Send
How are you handling encoding when generating the XML file? If you use the default encoding, then that'll be different between Windows and Unix.
+Pie Number of slices to send: Send
Thanks for the response

Here a sample xml that gets created with its encoding

<?xml version="1.0" encoding="ISO-8859-1" ?>
<report-list date="2008-12-22T00:00:00">
<report id="notifications_by_event">
<report-data>
<rowset>
<row>
<field name="date">2008-12-22T00:00:00</field>
<field name="alert_master_id">TESTSIVA19Inter Téléfónícá</field>
<field name="content_id">SP1000.admin.TESTSIVA19Inter1</field>
<field name="event_content">null</field>
<field name="total">1</field>
</row>
</report-data>
</report>
</report-list>
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
 

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.
Dinner will be steamed monkey heads with a side of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 5267 times.
Similar Threads
Castor unable to Map - please help
UTF-8 problem again, but still little diffrent
Ajax response and accented characters (richfaces)
Corrupt file name after compression.
Compression/Decompression encoding in unix.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:57:54.