Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    144

    Unanswered: Convert data charset

    hi
    i have a database with latin character set, with some data & i i want convert them to utf8.
    is there any tool for convert current data to utf8?

  2. #2
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    17
    Maybe

    alter table.... convert to charset charset_name
    ... default charset charset_name

    will help.

    Andreas

  3. #3
    Join Date
    May 2004
    Posts
    144
    this statement only change table structure, not data in table

  4. #4
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    17
    ok, 2nd try :-)

    • dump the table using mysqldump incl. drop table (--opt),
    • edit the create table statement in the dumpfile to utf-8 charset
    • reload the data


    mysql shoud be aware of the difference between client and table charset and do the conversion.

    another way could be to create new table 'table_uft8' and do a insert ... select with character conversion for each field

    insert into table_uft8(collumn1, collumn2, ...) select convert (collumn1 using utf8), convert (collumn2 using utf8), ... from table_org;

    and then swap tables by

    alter table table_org rename to table_iso;
    alter table talbe_utf8 to table_org;

    Andreas

Posting Permissions

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