If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Enforce exported data in UTF-8 format

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-04, 04:15
athensy athensy is offline
Registered User
 
Join Date: Feb 2004
Posts: 29
Enforce exported data in UTF-8 format

Hi,

I must export data from a table which contains Chinese characters, how could I enforce the exported data in UTF-8 format?

In addition, I must do it by using the UNLOAD command within DBACCESS as following example shown:

unload to "export.csv" delimiter '!'
SELECT field1
,field2
,field3
FROM my_table;

Is it possible to enforce exported data format within DBACCESS?

Thanks in advance.
Athens.
Reply With Quote
  #2 (permalink)  
Old 02-10-04, 04:53
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
You must set the server-locale variable to utf-8.
If your db_locale is also set to utf-8, there is no conversion while unloading.
__________________
rws
Reply With Quote
  #3 (permalink)  
Old 02-10-04, 21:00
athensy athensy is offline
Registered User
 
Join Date: Feb 2004
Posts: 29
Hi Roelwe,

Thanks for your help. However, I am a newbie for Informix, could you state more detail for the following:

1) How to set SERVER_LOCALE to UTF-8? Does it be set as

SERVER_LOCALE=UTF-8

in .profile or else other?

2) Now, the DB_LOCALE has been set to zh_TW.big5. How to change it
to UTF-8? Is it

DB_LOCALE=UTF-8 ?

3) Does it need to set SERVER_LOCALE and DB_LOCALE all together, or either one of them is enough to fulfil my task?

Thanks again for your help.
Athens.

Quote:
Originally posted by Roelwe
You must set the server-locale variable to utf-8.
If your db_locale is also set to utf-8, there is no conversion while unloading.
Reply With Quote
  #4 (permalink)  
Old 02-11-04, 01:19
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Quote:
Originally posted by athensy
Hi Roelwe,

Thanks for your help. However, I am a newbie for Informix, could you state more detail for the following:

1) How to set SERVER_LOCALE to UTF-8? Does it be set as

SERVER_LOCALE=UTF-8

in .profile or else other?

2) Now, the DB_LOCALE has been set to zh_TW.big5. How to change it
to UTF-8? Is it

DB_LOCALE=UTF-8 ?

3) Does it need to set SERVER_LOCALE and DB_LOCALE all together, or either one of them is enough to fulfil my task?


Thanks again for your help.
Athens.
Hi Atehns,

You can set the locales in your .profile or at your unix prompt, but in unix prompt it will be active only for that session, so its better to change it in your profile.

SERVER_LOCALE = en_us.utf8;
export SERVER_LOCALE;

Similarly you can do the same for DB_LOCALE too. But since your DB_LOCALE is already set to some other locale there could be conversion problems. You can try it out and see how it works.

Regards,

Lloyd
Reply With Quote
  #5 (permalink)  
Old 02-12-04, 01:13
athensy athensy is offline
Registered User
 
Join Date: Feb 2004
Posts: 29
Hi Lloyd,

Thanks for your information, I will try it to see the result.

Athens.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On