]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix compatibility issue with 64-bit cygwin.
[lyx.git] / src / Text.cpp
index 99d9cfb6070aba5ec4a952c98e932ffbef447257..bd4e23db0af4737c6c4bdc957c47e51feab775e6 100644 (file)
@@ -1008,7 +1008,10 @@ void Text::insertChar(Cursor & cur, char_type c)
 
        // Prevent to insert uncodable characters in verbatim and ERT
        // (workaround for bug 9012)
-       if (cur.paragraph().isPassThru() && cur.current_font.language()) {
+       // Don't do it for listings inset, since InsetListings::latex() tries
+       // to switch to a usable encoding which works in many cases (bug 9102).
+       if (cur.paragraph().isPassThru() && owner_->lyxCode() != LISTINGS_CODE &&
+           cur.current_font.language()) {
                Encoding const * e = cur.current_font.language()->encoding();
                if (!e->encodable(c)) {
                        cur.message(_("Character is uncodable in verbatim paragraphs."));