diff -Naur lyx-2.1.4.orig/src/Text.cpp lyx-2.1.4/src/Text.cpp --- lyx-2.1.4.orig/src/Text.cpp 2015-10-09 19:13:47.000000000 +0300 +++ lyx-2.1.4/src/Text.cpp 2016-11-02 15:23:43.813679102 +0300 @@ -1009,7 +1009,7 @@ // (workaround for bug 9012) // 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 && + if (cur.paragraph().isPassThru() && owner_->lyxCode() != LISTINGS_CODE && owner_->lyxCode() != ERT_CODE && cur.current_font.language()) { Encoding const * e = cur.current_font.language()->encoding(); if (!e->encodable(c)) {