Bug #6313 SELECT INTO OUTFILE and LOAD DATA don't support Chinese Filename
Submitted: 29 Oct 2004 5:25 Modified: 30 Sep 2008 6:58
Reporter: Lu Tao Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.1.7 OS:Microsoft Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[29 Oct 2004 5:25] Lu Tao
Description:
SELECT INTO OUTFILE
If the filename includes chinese charactor, it's changed
If the pathname includes chinese charactor, it's can't find the path name
LOAD DATA 
can recognize the orignal filename which I type in Select statement
can't recognize the orignal pathname which I type in Select statement

How to repeat:
E:\db\bin>mysqld-max-nt.exe --console

mysql> select * from aa;
+------+--------+
| a    | b      |
+------+--------+
| 1    | 111.11 |
+------+--------+
1 row in set (0.04 sec)

mysql> select * from aa into outfile 'e:/db/aa.txt';
Query OK, 1 row affected (0.00 sec)

mysql> select * from aa into outfile 'e:/db/中文.txt';
Query OK, 1 row affected (0.00 sec)

but the file name be changed  to '脰脨脦脛.txt'

mysql> select * from aa into outfile 'e:/db/新文件夹/中文.txt';
ERROR 1 (HY000): Can't create/write to file 'e:\db\脨脗脦脛录镁录脨\脰脨脦脛.txt
' (Errcode: 2)
mysql> load data infile 'e:/db/aa.txt' into table aa;
Query OK, 1 row affected (0.02 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 0

mysql> load data infile 'e:/db/中文.txt' into table aa;
Query OK, 1 row affected (0.00 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 0

mysql> load data infile 'e:/db/新文件夹/中文.txt' into table aa;
ERROR 1105 (HY000): File 'e:\db\脨脗脦脛录镁录脨\脰脨脦脛.txt' not found (Errcod
e: 2)

Suggested fix:
4.0.21 and earlier is ok
[29 Oct 2004 5:28] Lu Tao
comand window

Attachment: errmysql.GIF (image/gif, text), 19.41 KiB.

[29 Oct 2004 5:30] Lu Tao
windows explorer

Attachment: errmysql.PNG (image/x-png, text), 65.29 KiB.

[29 Oct 2004 16:45] Sinisa Milivojevic
Currently, MySQL does not support filenames in some of multi-byte character sets.

This is a problem that is caused by multi-byte char sequences containing a backslash. 

This is scheduled to be fixed in 5.1.
[30 Oct 2004 1:47] Lu Tao
but mysql 4.0 DOES support multibyte charactor set.
[30 Sep 2008 6:58] Konstantin Osipov
This bug was fixed with introduction of character_set_filesystem.