I can confirm that the solution provided by Janos works almost correctly.
In my case, I needed to use the Spanish characters: á, é, í, ó, ú, ñ, Á, É, Í, Ó, Ú and tried to solve it without results, until I compiled my file with xelatex instead of pdflatex.
In any case, you should modify listing.sty in the local copy or directly in the shared file and add the following:
\lst@CCPutMacro \lst@ProcessOther {"23}\# \lst@ProcessLetter{"24}\textdollar \lst@ProcessOther {"25}\% \lst@ProcessOther {"26}\& %spanish letters coded in UTF \lst@ProcessOther {"E1}{\'a} \lst@ProcessOther {"C1}{\'A} \lst@ProcessOther {"E9}{\'e} \lst@ProcessOther {"C9}{\'E} \lst@ProcessOther {"ED}{\'i} \lst@ProcessOther {"CD}{\'I} \lst@ProcessOther {"F3}{\'o} \lst@ProcessOther {"D3}{\'O} \lst@ProcessOther {"FA}{\'u} \lst@ProcessOther {"DA}{\'U} \lst@ProcessOther {"F1}{ñ} \lst@ProcessOther {"D1}{Ñ}
In my .tex file, I used the following options for lists:
\usepackage{listingsutf8} \lstset{ inputencoding=utf8, extendedchars=\true}
Hope this can help anyone, and maybe we can create a .sty list containing almost all UTF8 char ... :)
Jaboto Feb 09 '10 at 23:28 2010-02-09 23:28
source share