]> git.lyx.org Git - lyx.git/blobdiff - src/encoding.C
* src/tabular.[Ch]: simplify plaintext methods, because there
[lyx.git] / src / encoding.C
index 9c7b07d8184dc512e13990d559d54767caa9dbfc..a4a5f4932ae2f80bd82c31125079373e2bdcec37 100644 (file)
@@ -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)