The problem
I'm trying to insert the output of the tree command into a Program Listing field of LyX. The text is the following:
exampleFolder/
├── 01.mp4
├── 02.avi
├── 03.mov
└── 04.mpg
If this snippet is inserted in the main text, there are no problems, and the LyX-TeX document is compiled with no fuss.
If I put it inside a Program Listing field I get the following error message:
LyX: Uncodable characters in listing inset
The following characters in one of the program listings are not representable in the current encoding and have been omitted: ├──├──├──└──.
And this is the output PDF:
Debugging info
The LaTeX source for the toy example I made is the following:
\begin{document}
exampleFolder/
\textSFviii{}\textSFx{}\textSFx{} 01.mp4
\textSFviii{}\textSFx{}\textSFx{} 02.avi
\textSFviii{}\textSFx{}\textSFx{} 03.mov
\textSFii{}\textSFx{}\textSFx{} 04.mpg
\begin{lstlisting}
exampleFolder/
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 01.mp4
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 02.avi
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 03.mov
<LyX Warning: uncodable character '└'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 04.mpg
\end{lstlisting}
\end{document}
Related questions
Findings
I've tried to change the encoding of the document to extended UNICODE, and here we find the problem.
\inputencoding{latin9}\begin{lstlisting}[style=tree]
/home/teradeep/Work/Saliency/vid2img/Videos/exampleFolder/
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 01.mp4
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 02.avi
<LyX Warning: uncodable character '├'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 03.mov
<LyX Warning: uncodable character '└'><LyX Warning: uncodable character '─'><LyX Warning: uncodable character '─'> 04.mpg
\end{lstlisting}
\inputencoding{utf8x}
LyX encodes the lstlisting in latin9, while the rest of the document is in utf8x.
So, given that "[...] listings itself is not capable to typeset multibyte characters.", a workaround is to use \lstdefinestyle{tree} as proposed by Daniel.
Workaround
This is my solution, for now: I've inputted the code directly as text, formatted with \noindent \texttt \scriptsize and replaced the space character (which was not supported) with a \hspace{1.5em}.
\noindent \texttt{\scriptsize{}Videos}{\scriptsize \par}
\noindent \texttt{\scriptsize{}├── exampleFolder}{\scriptsize \par}
\noindent \texttt{\scriptsize{}│\hspace{1.5em}├── 01.mp4}{\scriptsize \par}
\noindent \texttt{\scriptsize{}│\hspace{1.5em}├── 02.avi}{\scriptsize \par}
\noindent \texttt{\scriptsize{}│\hspace{1.5em}├── 03.mov}{\scriptsize \par}
\noindent \texttt{\scriptsize{}│\hspace{1.5em}└── 04.mpg}{\scriptsize \par}
[...]
This is the output. I think it's pretty decent.

