tags:

views:

30

answers:

2

Hi Folks, 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

A: 

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.

FractalizeR
mysql> select @@version; --> 4.1.10-log. I think it does not support this option. It is giving error.
Nayn
OMG Ponies
A: 

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

Nayn