从mysql导出unicode数据
我的 mysql 表中有一些数据存储为 utf8。数据是一些日语文本。我需要将其导出到Excel。你能告诉我该怎么做吗? 通过 SELECT ... INTO OUTFILE 导出会返回一些纯文本文件。我不知道如何在 Excel 中读回它以便日文字符能够正确显示
谢谢 纳恩
I have some data in one of my mysql table stored as utf8. The data is some japanese text. I need to export it to excel. Could you tell how to do it?
Exporting by SELECT ... INTO OUTFILE
returns some plain text file. I'm not sure how to read it back in excel so that japanese character would show properly
Thanks
Nayn
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您执行 SELECT INTO OUTFILE 作为导出选项时,只需提供字符集 charset_name http:// /dev.mysql.com/doc/refman/5.0/en/select.html 你会没事的。如果您在使用 Excel 直接打开时遇到一些问题,请让它在“打开”对话框中使用通用过滤器 . 导入数据。然后它会让您选择要导入的文件编码。
Just provide CHARACTER SET charset_name when you do SELECT INTO OUTFILE as export_option http://dev.mysql.com/doc/refman/5.0/en/select.html and you will be fine. If you will have some troubles with direct opening with Excel, have it import data using universal filter . in Open dialog. It will then let you select file encoding to import.
实际上,文本文件按原样保留数据。只是如果我们直接在excel中打开,它会误解文件的字符编码。我使用记事本打开它并以编码保存为“utf8”。下次当我在 Excel 中打开它时,它会正确显示字符。
谢谢
纳恩
Actually the text file retains the data as is. It is just that if we open directly in excel, it misinterprets the character encoding for the file. I opened it using notepad and saved in encoding as 'utf8'. next time when i opened it in excel it showed the characters properly.
Thanks
Nayn