Encoding character set in content.xml

Discuss the word processor
Post Reply
gers32
Posts: 2
Joined: Mon Dec 03, 2007 3:16 pm

Encoding character set in content.xml

Post by gers32 »

Hi,

I'm developing a Ruby-on-Rails+Flex Web application which generates an ODT file and sends it to the browser.

The data comes from an Oracle database encoded with Windows-1252. Unfortunately, the generated file displays Asian characters in place of the typically French characters in the database (accented vowels, etc). Opening content.xml, I noticed the following encoding information:

<?xml version='1.0' encoding='UTF-8'?>

The source of this encoding information is the ODT template that I created. Assuming this is the cause of my problems, is there a way to generate an ODT template with a different encoding (Windows-1252)?

And maybe this is not the real cause, but someone has a solution... Thanks,

Chris.
OOo 2.3.0 on MS Vista
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Encoding character set in content.xml

Post by TerryE »

The ODF formants including ODT all use UTF-8. Sorry, but its not practical to change that. The easiest way is to work in UTF-8 and to convert your fields in Oracle from CP-1252 on input and update. I did a google on "1252 utf-8 conversion ruby" and got loads of hits. Why not do likewise and have a browse?
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
gers32
Posts: 2
Joined: Mon Dec 03, 2007 3:16 pm

[SOLVED] Re: Encoding character set in content.xml

Post by gers32 »

Thank you Terry, your suggestion helped me solve this problem. I was able to convert the data directly in the SQL query, via the 'CONVERT' function.
OOo 2.3.0 on MS Vista
Post Reply