#include "support/lstrings.h"
#include "support/textutils.h"
+using lyx::support::escape;
+
namespace lyx {
void InsetMathString::write(WriteStream & os) const
{
if (!os.latex() || os.lockedMode()) {
- os << str_;
+ os << (os.asciiOnly() ? escape(str_) : str_);
return;
}
}
case WriteStream::wsPreview: {
// indicate the encoding error by a boxed '?'
- os << "{\\fboxsep=1pt\\fbox{?}}";;
+ os << "{\\fboxsep=1pt\\fbox{?}}";
LYXERR0("Uncodable character" << " '"
<< docstring(1, e.failed_char)
<< "'");