#include "support/lstrings.h"
#include "support/unicode.h"
+#include <sstream>
+
namespace lyx {
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 {
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)