PHPMyAdmin doesn't import unicode

2019-03-04 16:08发布

When I use the import feature of PHPMyAdmin, it doesn't import non-ASCII characters such as ä, ö, ü, õ and the rest of the word after the characters.

When I open the CSV file with Notepad it displays the non-ASCII characters normally, but when I'm trying to import it - it doesn't work.

Entering those missing characters manually works and MySQL saves them just as it should. Any thoughts?

2条回答
smile是对你的礼貌
2楼-- · 2019-03-04 16:26

mySQL will do this when it encounters a character that is invalid under the current character set.

You're not mentioning what tool you are using to import the data, but you should be able to specify a character set when importing. If that character set matches the database's, everything will be fine. Also, make sure the file is actually encoded in that character set.

If your import tool doesn't offer the option of selecting the character set, you could try phpMyAdmin which does.

查看更多
Emotional °昔
3楼-- · 2019-03-04 16:44

Make sure you know what the encoding of your CSV file is - it should be UTF-8. Then before you import, type 'use utf8', and it should work fine.

查看更多
登录 后发表回答