X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fencoding.C;h=a4a5f4932ae2f80bd82c31125079373e2bdcec37;hb=e7f4618bcce770369cf46335c2c7f0164b4b8857;hp=9c7b07d8184dc512e13990d559d54767caa9dbfc;hpb=f0fa6f44488367e895865bdfed097ee449100ee1;p=lyx.git diff --git a/src/encoding.C b/src/encoding.C index 9c7b07d818..a4a5f4932a 100644 --- a/src/encoding.C +++ b/src/encoding.C @@ -211,7 +211,10 @@ CharInfoMap unicodesymbols; Encoding::Encoding(string const & n, string const & l, string const & i) : Name_(n), LatexName_(l), iconvName_(i) { - if (n == "utf8") + if (n == "ascii") + // ASCII can encode 128 code points and nothing else + start_encodable_ = 128; + if (n == "utf8" || n == "utf8x") // UTF8 can encode all 1<<20 + 1<<16 UCS4 code points start_encodable_ = 0x110000; else { @@ -259,13 +262,9 @@ docstring const Encoding::latexChar(char_type c) const void Encoding::validate(char_type c, LaTeXFeatures & features) const { - if (c < start_encodable_) - return; - - if (encodable_.find(c) != encodable_.end()) - return; - - // c cannot be encoded in this encoding + // Add the preamble stuff even if c can be encoded in this encoding, + // since the inputenc package only maps the code point c to a command, + // it does not make this command available. CharInfoMap::const_iterator const it = unicodesymbols.find(c); if (it != unicodesymbols.end() && !it->second.preamble.empty()) { if (it->second.feature)