The following MWE works fine when compiling with the LaTeX engine (AUCTeX 11.86)
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
áéíóúñ
\end{document}
However, with the XeTeX engine I get the following error:
ERROR: Package inputenc Error: Unicode char \u8:áéí not set up for use with LaTeX
--- TeX said ---
.
See the inputenc package documentation for explanation.
If I change the input encoding to Latin-1 the document compiles correctly. Why is XeTeX rejecting the UTF-8 encoding?
I tried the suggestions given in Typeset directly in Spanish and in AUCTeX and XeTeX but neither help.
inputencpackage and now it works as I expected it to. I also saw in one of the log files that XeTeX begs the user not to useinputenc. On another note, would specifying\usepackage{lmodern}be redundant when usingfonstpec? – Ricardo May 06 '12 at 17:18lmodern.styis for enabling the "old style" fonts, whilefontspec, by default, loads the OpenType version of the Latin Modern fonts – egreg May 06 '12 at 20:48\usepackage[T1]{fontenc}is needed with XeLaTeX – doed Aug 25 '14 at 17:07fontencin XeLaTeX; it might be in some cases, but not usually. – egreg Aug 25 '14 at 18:00t1enc.defmust be loaded. – doed Aug 25 '14 at 18:27