I've encountered a problem with Unicode Windows file name.
If I set the file name to Unicode characters on Mac OSX, it works well. But on Windows if the filename starts with a digital number or the filename/path contains Unicode characters, it will not work well. (I am using Chinese Windows version, and Windows may be using GBK codings.)
If the filename starts with a digit, the \
will escape
the following digit.
If the filename/path contains a Unicode character, Mathematica will not find the file in some situations.
This works:
This does not work (it tells me the file cannot be found):
Sorry the pictures are captured using Mac (it works), as on Windows system, the path separator will not be /
but be \
. So it will cause the problem mentioned above.
Btw, I am using this to get the filename.
Edited
Sorry for late. I managed to find a Windows PC and got the file name as a string.
Here is the Unicode file name on Windows:
ExcelFileName
"C:\Users\jinyongjie\Desktop\20161228合纵科技并购.xlsx"
@Stitch I tried to replace the directory separator, but still cannot work:
StringReplace[ExcelFileName,"\\"->"/"]
"C:/Users/jinyongjie/Desktop/20161228合纵科技并购.xlsx"
\\
or\
on windows? $\endgroup$FileNameSetter
does not generate double slash for filenames, and that caused file not found problems in some cases? $\endgroup$/
on Windows as well. $\endgroup$