X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathString.cpp;h=44aad43c805075d3176fa88d4fe670ba1e1222a0;hb=efaae780dbbe3685e26e040ed4255e5abf268106;hp=5217566c219bcd4899cd0530be2c35618830f72d;hpb=51c380440b0b2d5f04158e67047727ba1f985dc4;p=lyx.git diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp index 5217566c21..44aad43c80 100644 --- a/src/mathed/InsetMathString.cpp +++ b/src/mathed/InsetMathString.cpp @@ -120,7 +120,7 @@ void InsetMathString::write(WriteStream & os) const docstring command(1, c); try { bool termination = false; - if (c < 0x80 || + if (isASCII(c) || Encodings::latexMathChar(c, mathmode, os.encoding(), command, termination)) { if (os.textMode()) { if (in_forced_mode) { @@ -129,12 +129,12 @@ void InsetMathString::write(WriteStream & os) const os.textMode(false); in_forced_mode = false; } - if (c >= 0x80 && os.textMode()) { + if (!isASCII(c) && os.textMode()) { os << "\\ensuremath{"; os.textMode(false); in_forced_mode = true; } - } else if (c < 0x80 && in_forced_mode) { + } else if (isASCII(c) && in_forced_mode) { // we were inside \ensuremath os << '}'; os.textMode(true);