[Tex/LaTex] ‘fontspec’ package problem with XeLaTeX in MiKTeX 2.9

errorsfontspecmiktexxetex

Recently, I updated to MiKTeX 2.9, and after this the xelatex compiler fails when compiling documents with the fontspec package included. In other words, the following code won't compile:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Cambria}

\begin{document}
Hello world!
\end{document}

I don't know what has changed when I updated to MiKTeX 2.9, but I get the following build log message in TeXnicCenter:

("C:\Program Files\MiKTeX 2.9\tex\latex\euenc\eu11mr.fd")
xelatex.exe: Windows API error 1113: No mapping for the Unicode character
exists in the target multi-byte code page.

The same thing seems to be the problem when compiling in TeXWorks.

I've tried reinstalling MiKTeX 2.9 to make sure everything was up to date, but this did not help.

Does anyone have any idea how I can solve this problem? Answers are much appreciated.

EDIT:

Here's a list of specifics:

  • All outdated packages have been updated, and the file name database has been refreshed.
  • I do get a log file when compiling. The only file I don't get is the pdf output.
  • The operating system I'm using is Windows Vista.
  • The xelatex --no-pdf file cmd (terminal) command gives the same error message as quoted above.
  • My user name does contain a non-ASCII character. However none of the characters are outsude the Latin-1 charset.
  • No other file or folder has a non-ASCII character.

Best Answer

I'm getting the same error message:

pdflatex: Windows API error 1113 : No mapping for the Unicode character exists in the target multi-byte code page.

with newest updates installed (Miktex 2.9 and all available updates installed on 2011-12-24). With about half a year ago the file worked perfectly.

The reason for the problem was that I was using a scandinavian character in my file name when using \includegraphics:

\includegraphics[width=8cm,height=7cm,keepaspectratio]{å}

When I renamed the file from å.jpg to ae.jpg, the error message disappeared:

\includegraphics[width=8cm,height=7cm,keepaspectratio]{ae}

The problems you are experiencing might have something to do with character encoding in file names.

Hope this helps anyone getting that error message with similar reason.

Related Question