0

I got the next CSV file:

1 Café 
2 Chair
3 Hallå
4 Dog

(And ~10000 more rows of words of all latin characters)

I'm trying to get this data into a mysql table using phpMyAdmin.

But even though I've set both the database and table encoding to utf8_bin, what I get after import is:

2 Chair
4 Dog

Meaning all non-english characters makes the whole row disappear from the table.

I've also tried utf8_general_ci, which I think doesn't suppose to work, and indeed, it didn't work.

Which encoding should I use? Or, is there something I can do with the file before import that will allow me to import it correctly?

STT LCU
  • 4,348
  • 4
  • 29
  • 47
Roy
  • 1,307
  • 1
  • 13
  • 29
  • 1
    You need to make sure the connection is encoded properly. Possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Pekka Dec 30 '13 at 15:15
  • Not really, my database and tables already encoded as utf8, as suggested in the top answer. I'm just seem to miss something more specific – Roy Dec 30 '13 at 15:22
  • 1
    Can you show some code? – Pekka Dec 30 '13 at 15:23
  • @Pekka웃 I'm using phpMyAdmin – Roy Dec 30 '13 at 15:38

1 Answers1

1

Well, this is embarrassing, but it might be helpful for somebody in the future.

While I did set both the database and table encoding to utf8_bin, I've ignored the fact that the column encoding was set to utf8_general_ci. Fixing the column encoding made the import successful.

Use utf8_bin on both database, table, and column.

Roy
  • 1,307
  • 1
  • 13
  • 29