2

I'm trying to parse a big JSON file, which has all kinds of languages (russian, swedish etc). I read this JSON file using PHP, make queries out of the data, save the queries into a text file and load the data into a mysql database from this sql file.

It all seems to work, except for the special characters. If I cat the sql file (on a mac terminal), I can see the characters correctly. If I open the file in vi, the characters are all jumbled up. And if I try to load the SQL file into mysql, I get errors.

My table is set to UTF8. What other steps do I need to take to fix this problem?

user187809
  • 706
  • 2
  • 8
  • 23
  • This question may help: http://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Michas May 10 '15 at 15:00
  • Do `SELECT col, HEX(col) ...` on some of the text in the mysql table. From that we can see if it was garbled before (or after) `INSERTing`. Also provide `SHOW CREATE TABLE`. – Rick James May 10 '15 at 23:58

0 Answers0