Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    30

    Unanswered: 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.

  2. #2
    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

  3. #3
    Join Date
    Feb 2004
    Posts
    30
    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.

    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.

  4. #4
    Join Date
    Aug 2003
    Location
    India
    Posts
    262
    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

  5. #5
    Join Date
    Feb 2004
    Posts
    30
    Hi Lloyd,

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

    Athens.

  6. #6
    Join Date
    Aug 2014
    Posts
    1
    Try this:

    DB_LOCALE=EN_US.57372; export DB_LOCALE
    CLIENT_LOCALE=EN_US.57372; export CLIENT_LOCALE

    This should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •