In MySQL you can use the LOAD DATA INFILE syntax to import so-called CSV fiiles into one of your database tables. I recently needed to do this to import data from Microsoft Access.
Because there were several French accent signs and other strange characters in the database, I chose UTF-8 encoding for both the CSV file and the target table in MySQL.
The problem was, that this method did not work. All my special characters were corrupted. The solution finally was to set the character_set_database environment variable of MySQL to UTF-8 before executing the query:
SET character_set_database=utf8;LOAD DATA LOCAL INFILE '/tmp/somefile.txt' REPLACE INTO TABLE tmpsomefiletableFIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"';SET character_set_database=default;
The last SQL statement resets the environment value back to the default one. It is – of course – optional.