I'm trying to highlight a couple of keywords which contain non-ASCII characters using the listingsutf8 package. This is the relevant part of my document:
\usepackage[brazilian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{listingsutf8}
\lstset{
extendedchars=true,
inputencoding=utf8x,
keywords={Funcionalidade, Para, Como, Eu, Contexto, Cenário, Dado, Quando, Então},
literate=%
{á}{{\'a}}1
{ã}{{\~a}}1
{ç}{{\c{c}}}1
{é}{{\'e}}1
{ê}{{\^e}}1
{õ}{{\~o}}1
{ó}{{\'o}}1
}
The ASCII only keywords are being highlighted correctly, but the Cenário and Então keywords are not. I have also tried with emph and changing inputencoding, but it doesn't work either:
\lstset{
inputencoding=utf8/latin1,
emph={Cenário, Cen\'ario, Cenario},emphstyle={\bfseries}
}
If it's relevant, the listing I'm trying to highlight comes from a separate file, using the \lstinputlisting command. If I had to guess, I would say that it has something to do with the literate params.
Cenárioas keyword does what you want. Please, try providing a minimal example. – egreg Dec 09 '11 at 16:23