Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I tried to import file in Mathematica 10 ( windows 7 system), the path contains some chinese characters. After holding ctrl+shift, and drag the file into front end. I got path like

c:\\Users\\m&p\\Desktop\\桌面\\test.txt

But after running

Import["c:\\Users\\m&p\\Desktop\\桌面\\test.txt"]

Mathematica 10 gives error message as follows:

Import::nffil: File not found during Import.

What should I do to make mathematica 10 support path containing Chinese characters?

share|improve this question
1  
What kind of computer are you using: Macintosh, Raspberry Pi, Linux, or Windows? –  librik Jul 17 at 2:41
1  
Works fine on OS X. This is expected to be OS-dependent. Are you on Windows? What language version of Windows? There's also a setting in Windows (which I don't know where it is anymore, as I don't have a Windows computer here) that will adjust the character set for software that doesn't support Unicode. If you like to use Chinese path names, it's worth setting that to Chinese. Otherwise non-Unicode-aware Windows programs won't see those paths. –  Szabolcs Jul 17 at 2:48
2  
    
I cannot reproduce this problem under linux. Here is what I tried (and with success): (1) create directory /tmp/试验. (2) put a file try.dat with some data in it. (3) In Mma10, Import["/tmp/试验/try.dat"]. And I don't have problem to get the content of the file. It is perhaps OS dependent? –  Yi Wang Jul 17 at 10:47
1  
@AlexeyPopkov Yes, I confirm that if I put a special character after `\`, I also got strange character code under Linux. –  Yi Wang Jul 18 at 6:39

1 Answer 1

up vote 7 down vote accepted

In Mathematica 10.0.0 for Windows, I have experienced similar problems.
When non-ASCII characters were placed after \ in a string, they were decoded in a strange way. (Character '\' is used as a path separator in Windows).

ToCharacterCode["\\a", "Unicode"](*OK*)
{92, 97}

ToCharacterCode["\\", "Unicode"](*OK*)
{92}

ToCharacterCode["μ", "Unicode"](*OK*)
{956}

ToCharacterCode["\\μ", "Unicode"](*Strange!*)
{92, 92, 58, 48, 51, 98, 99}

"μ" in this expample can be some Chinese/Japanese characters. It makes a severe problem because this sometimes happens in file path such as "C:\MyData\μ-channel\" in Windows. You could avoid this problem by using "c:/MyData/μ-channel/".

share|improve this answer
    
Have you already reported this to Wolfram support? –  Szabolcs Jul 17 at 14:37
3  
Yes. I have reported the problem at 7/14 ([CASE:1213192]). But no responses yet. –  Tetsuo Ichii Jul 17 at 15:02
3  
(Updated) I received a reply today from Wolfram research: "... I am able to reproduce the issue you found and will file a report on it. ...". –  Tetsuo Ichii Jul 17 at 23:58
    
@TetsuoIchii So this is a bug? –  matheorem Jul 18 at 14:47
    
Yes. I think it is a bug. Please try "c:/Users/m&p/Desktop/桌面/test.txt" to circumvent the problem. –  Tetsuo Ichii Jul 19 at 15:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.