How to fix mysql data encoding -


i'm working on database names saved in using latin1 character set encoding (latini_swedish_ci collation) names in persian.

seems body changed table collation utf8 (utf8_bin) still data :

enter image description here

i'm wondering how can fix values.

changed table collation , db collation still have kind of values. appreciate.

thank's in advance

it looks had

  • utf8-encoded bytes in client, and
  • set names latin1 (or equivalent), and
  • character set latin1 on target column.

the "fix" clean table 2-step alter described here, involves

alter table tbl modify column col varbinary(...) ...; alter table tbl modify column col varchar(...) ... character set utf8 ...; 

where lengths big enough , other "..." have whatever else (not null, etc) on column.

sorry, take long time fix 1500000 rows.

i pretty sure not work:

alter table tbl convert character set utf8;  -- no 

it work if table contains latin1 (etc) equivalent of utf8 characters. there no latin1 equivalent arabic characters.

(i see arabic: باسلام --> باسلام)


Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

objective c - Deep Linking for iOS Apps which are not installed yet? -

hex - Lua: Hexadecimal Word to Binary Conversion -