hi all, recently I hava a problem to insert code in lstlisting environment of Lyx 2.0.0alpha2,which described in bug report:
http://www.lyx.org/trac/ticket/6766 but it's so urgent for me to solve this problem out. so I have to dig into the source code of Lyx(the same rev as descried above), and I found the problem is that Lyx would judged the text input encoding is "latin1" when it encounter singlebyte. then if the text is treated as "uncodable" and make a big error in relegated step after. you man check handling detail in the source code "InsetListings.cpp" which located in "src/insets/" from line 151~152,and real source code from line 153~156. here is my method to fixs it: I change the source file line 156 with replace "iso8859-1"(as author said it latin1) with "utf8", and remake the source code and install it to my Ubuntu. afte fix it,all problem in the bug report seems to be gone,and luckly,it generate PDF also works and the result is fine. as discussed above, it seems to be the latex package lstlisting handle utf8-enocoded text well. as I using Xetex now so it possible Xetex has some effort for it,but I have the time to research it. I strongly suggests that Lyx team should officially solved this problem( may be in the latest release? ) ,and I looking forward that. [email protected](http://ubuntu9.com)
