I'm using the following syntax for my code snippets
\begin{minipage}{\textwidth}
\begin{lstlisting}[caption=<something>, label=<something>]
The REST Endpoint URL
is http://api.flickr.com/services/rest/
To request the flickr.test.echo service,
invoke like this:
http://api.flickr.com/services/rest/
?method=flickr.test.echo&name=value
By default, REST requests will send a REST response.
\end{lstlisting}
\end{minipage}
and I would like to have
\begin{code}[<caption>, <label>]
... code ...
\end{code}
which would behave exactly the same.
So I tried this thing but it won't compile and I can't spot the problem
\newenvironment{code}[2][]%
{
\minipage{\textwidth}
\lstset{
basicstyle=\ttfamily,
breaklines=true,
captionpos=b,
frame=bottomline,
extendedchars=true
}
\begin{lstlisting}[caption=#1, label=#2]
}
{
\end{lstlisting}
\endminipage
}
Error when running pdflatex
! Package inputenc Error: Unicode char \u8:�\expandafter not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
