}
-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;
package = Encoding::inputenc;
else if (p == "CJK")
package = Encoding::CJK;
+ else if (p == "japanese")
+ package = Encoding::japanese;
else
lex.printError("Unknown package");