[XeTeX] xetex + listings + inputencoding

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Feb 4 09:28:56 CET 2009


M. Niedermair wrote:
> Hi,
> 
> what is the best way, to include listings in utf8/iso8859-1 encoding.
> 
> In the listings doc i found:
> 
> inputencoding=<encoding>
> determines the input encoding. The usage of this key requires the 
> inputenc package; nothing happens if it’s not loaded.
> 
> % ---------------------------------
> \documentclass{scrartcl}
> \usepackage{xltxtra}
> \usepackage[final,writefile]{listings}
> \lstloadlanguages{java,HTML,[AlLaTeX]TeX,make}
> \begin{document}
> Listing 1 (utf8)
> 
> \lstinputlisting{list1.java}
> 
> Listing 2 (iso8859-1)
> 
> \lstinputlisting[inputencoding=latin1]{list2.java}
> \end{document}
> % ---------------------------------
> 
> If i use the sample, i see the correct chars in list1.java, but in 
> list2.java the chars are missing.
> 
> If i use the package inputenc, i get the message
> *** you should *not* be loading the inputenc package
> 
> If i use
> \usepackage[inputencoding=utf8/latin1]{listingsutf8}
> i get some errors.
> 
> What can i do?

Have you tried loading the second example file without the inputencoding
key?
-- 
Joseph Wright


More information about the XeTeX mailing list