# [XeTeX] Problem with \XeTeXinputencoding

Ulrike Fischer news2 at nililand.de
Fri Aug 1 14:38:25 CEST 2008

Am Fri, 1 Aug 2008 19:08:51 +0800 (CST) schrieb Xiao Cui:

> I am using TL2008test-20080724. The XeTeX version is 0.999.3
>   It also fails when I try xelatex --no-pdf main.
>
>   I know that it is not necessary to set the encoding to utf8.
>   In fact, I have this trouble when I am using other encodings, say "gbk".
>   And I find that it fails if the included file begin with \XeTeXinputencoding ....
>
>   It gives the right result when I comment out the "\XeTeXinputencoding ...." line.
>
>   It is also right after adding something  like \section{a}' below the first line.
>
>   I am attaching the files (tex/aux) as an attachment.

Ok I now can reproduce it. It even fails with a simple \input. And it
\section helps too but only in the sense that now a page is produced,
but the last line is still lost.

I remember a similar problem which was discussed in d.c.t.t: In the
following example the "\end{document}" was lost -- but only if it was on
the last line in the document and also only if a \XeTeXinputencoding is
involved.

\XeTeXinputencoding "cp1252"

\documentclass{report}

\usepackage[ngerman]{babel}
\usepackage{fontspec}

\begin{document}
Test Ö

\end{document}

It looks as if the switch between encodings is eating the last line.

--
Ulrike Fischer

`