}
-Encoding::Encoding(string const & n, string const & l, string const & i,
- bool f, Encoding::Package p)
- : name_(n), latexName_(l), iconvName_(i), fixedwidth_(f), package_(p)
+Encoding::Encoding(string const & n, string const & l, string const & g,
+ string const & i, bool f, Encoding::Package p)
+ : name_(n), latexName_(l), guiName_(g), iconvName_(i), fixedwidth_(f), package_(p)
{
if (n == "ascii") {
// ASCII can encode 128 code points and nothing else
}
-docstring Encoding::latexChar(char_type c) const
+docstring Encoding::latexChar(char_type c, bool for_mathed) const
{
// assure the used encoding is properly initialized
init();
return docstring(1, c);
if (encodable_.find(c) != encodable_.end())
return docstring(1, c);
+ if (for_mathed)
+ return docstring();
// c cannot (or should not) be encoded in this encoding
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
}
-bool Encodings::latexMathChar(char_type c, docstring & command)
+bool Encodings::latexMathChar(char_type c, Encoding const * encoding,
+ docstring & command)
{
+ if (encoding) {
+ command = encoding->latexChar(c, true);
+ if (!command.empty())
+ return false;
+ }
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end())
throw EncodingException(c);
CharInfoMap::const_iterator it = unicodesymbols.begin();
size_t unicmd_size = 0;
- char_type c;
+ char_type c = 0;
for (; it != uniend; ++it) {
docstring const math = it->second.mathcommand;
docstring const text = it->second.textcommand;
lex.next();
string const latexname = lex.getString();
lex.next();
+ string const guiname = lex.getString();
+ lex.next();
string const iconvname = lex.getString();
lex.next();
string const width = lex.getString();
package = Encoding::inputenc;
else if (p == "CJK")
package = Encoding::CJK;
+ else if (p == "japanese")
+ package = Encoding::japanese;
else
lex.printError("Unknown package");
LYXERR(Debug::INFO, "Reading encoding " << name);
encodinglist[name] = Encoding(name, latexname,
- iconvname, fixedwidth, package);
+ guiname, iconvname, fixedwidth, package);
if (lex.lex() != et_end)
lex.printError("Missing end");