TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I cannot compile files with non-ASCII paths. I am using XeLaTeX from MikTex and TexStudio on Windows. Is it possible to read paths as utf8?

The specific path contains Chinese. If I change what encoding Windows use for non-Unicode programmes to Chinese, the file compiles. The problem is that other Swedish programmes require me to switch back to Swedish encoding when I want to use them. This means that I have to reconfigure (including rebooting) the system every time I want to use the other programme, which is not very desirable.

This is the message I get in TexStudio when I try to compile a file with Chinese characters in its path:

Process started: xelatex.exe -synctex=1 -interaction=nonstopmode "main".tex

MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1 ** WARNING ** Couldn't
open font map file "kanjix.map". ** WARNING ** TrueType post table name index 32768
> 32767 ** WARNING ** Filtering file via command -->mgs.exe -q -dNOPAUSE -dBATCH 
-dEPSCrop -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dAutoFilterGrayImages=false 
-dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false 
-dColorImageFilter=/FlateEncode -sOutputFile="C:/Users/XXX/AppData/Local/
Temp//xdvipdfmx.1d4298f2fd03f60dc7a645274462" "E:/备豪/ä–‡è‰ä¼´/project/
illustrations/zi.eps" -c quit<-- failed. ** WARNING ** Image format conversion 
for "E:/备豪/ä–‡è‰ä¼´/project/illustrations/zi.eps" failed... ** ERROR ** pdf_ref_
obj(): passed invalid object. Output file removed. xelatex.exe: Invalid argument

Process exited with error(s)

(Disregard the kanjix.map error, its always there.)

share|improve this question
Try adding --shell-escape to the pdflatex options. – Big-Blue Mar 29 '14 at 8:53
I tried on XeLaTex and I still get the same error. – MunHo Mar 29 '14 at 9:44
Are you using the non-ascii chars in the \includegraphics command? – Ulrike Fischer Mar 29 '14 at 13:32
@UlrikeFischer Yes, at some places. Is that the cause of the problem? In the error message it looks like it is the path to the main file that is messed up into gibberish characters. – MunHo Mar 30 '14 at 8:01
There is no need to speculate: You can test it. Comment the graphics with non-ascii chars in the includegraphics command and try out what happens. – Ulrike Fischer Mar 30 '14 at 10:32

Your Answer


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

Browse other questions tagged or ask your own question.