Mysql export and import utf8 data: best practices

We often encounter the need to send a data file to one of our customers with data from the database that it needs to translate. In most cases, this export is CSV or XLS. Most of the time we create ds csv with phpmyadmin and get the xls file instead with the translated data. The problem is that most of the time UTF8 data and when the file is returned as xls every time we load the data again in mysql, we end up with utf8 problems, the characters are not displayed properly, etc.

We have already double-checked everything in mysql from my.conf to columns, and everything is correctly configured for UTF8.

My question is not how to fix the encoding problem, since it was solved, but how will we best act in the future in this situation? What export format should we transfer? How do we import (just mysql load data infile or our own processing scripts). What is the general consensus on how to deal with this situation?

We would like to continue using excel, if possible, as the format that almost everyone expects, including the translation agencies of our clients. The ease of use of our customers is the most important factor here, without overloading us with major problems every time. The best of both worlds :)

+3
source share
1 answer

. utf-8.

CSV ( ) ( ) CSV utf-8 script (Python) LOAD DATA INFILE.

character_set_database ( ​​ ) MySQL 5.1.17 CHARACTER SET LOAD DATA INFILE.

, , , MySQL 3 4 ( ).

, SELECT... INTO OUTFILE.

+1

Source: https://habr.com/ru/post/1743944/


All Articles