This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Informix problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Informix problem" Watch "Informix problem" New topic
Author

Informix problem

Prashant Wu
Greenhorn

Joined: Nov 29, 2005
Posts: 4
Hi,

I am preparing a site in which i need to provide a functionality to user where user can input the data in japanese language. Its a J2EE based application. My database is informix. The problem is..when i keep the encoding of my page to 8859_1, the characters are inserted correctly in database. But I want the encoding of my page to be utf-8. Now, when i change the encoding of my page to utf-8 and insert the text in database, the japanese text inserted becomes '???'. i.e. the characters are corrupted.

I came to know that there is a parameter called DB_LOCALE in informix database which I will have to set to en_US.UTF8. Can anybody help me if this is the correct solution to this problem? If this is the solution, can you please tell me, where and how do i make this change in database?

When I access my database using dbaccess and go to database->info->Nls, it displys
en_US.819 Collating Sequence
en_US.819 CType

Can anybody please throw some light on this? Appriciate your help. This is bit urgent.


Warm Regards,<br />Prashant...
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 804

Found this on the web:

You have to set db_locale to your locale (I assume something like FR_fr.1252 for you) BEFORE creating the database.

If you are still using isql dont create the database in it. It will NOT use the db_locale setting. Use dbaccess instead.
Informix Answers
- I am too far away from my Informix books, and any Informix servers (I don't do Informix at work now ). Here's a link to an old book: Informix Unleased - might help you with other things.


Regards Pete
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Informix problem