开发者

Howto upload a file encoded in UCS-2 Little Endian into a Mysql table in UTF-8

开发者 https://www.devze.com 2023-04-10 14:02 出处:网络
I have a csv file encoded in UCS-2 Little Endian which I would like to upload into my MySQL table which is encoded in UTF-8 - default collation.I\'m curious as to what the best approach is.If I need t

I have a csv file encoded in UCS-2 Little Endian which I would like to upload into my MySQL table which is encoded in UTF-8 - default collation. I'm curious as to what the best approach is. If I need to write a script I can do that although I'm hoping there is a simple solution!

Thanks,开发者_如何学运维 AFrieze


  • Windows: Use Notepad++, Encoding menu / Convert to UTF-8 without BOM
  • Linux: Use recode utility: recode ucs2..utf8 thefile.csv

Then mysqlimport --default-character-set utf8 ... (usual stuff)

0

精彩评论

暂无评论...
验证码 换一张
取 消