2

I have a UTF8 mysql database and I had to import a latin1 table to it. I was hoping I could fix data errors after I had imported. Is a huge table containing all the adresses from my country. So data is been dispayed like that:

Arapiraca  A. José da Silva        Manoel Teles  57305-075  Rua
Maceió    Abelardo Pugliese        Jatiúca      57036-020  Rua 

I followed a hint saing that I should convert all TEXT fields into BLOB them convert the table to UTF8 and for the last change the BLOB fields back to TEXT.

Here is the reference: https://www.percona.com/blog/2013/10/16/utf8-data-on-latin1-tables-converting-to-utf8-without-downtime-or-double-encoding/

Now my datababase and table are UTF8 and data still displaying wrong! Is there a way to solve that?

Guilherme Longo
  • 605
  • 3
  • 9
  • 18
  • Look at this http://stackoverflow.com/questions/9407834/mysql-convert-latin1-characters-on-a-utf8-table-into-utf8 – White Feather Mar 25 '16 at 10:55
  • @WhiteFeather tks, I had read this post but without understand it. Now that u mentioned it I took more time over it and figured out how it must be done. If you post your suggestion I´ll accept it as an answer! – Guilherme Longo Mar 25 '16 at 12:50

1 Answers1

1

Following this answer:

MySQL - Convert latin1 characters on a UTF8 table into UTF8

you can make a function:

CONVERT(CAST(CONVERT(name USING latin1) AS binary) USING utf8)

and apply it.

Community
  • 1
  • 1
White Feather
  • 2,733
  • 1
  • 15
  • 21