]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathHull.cpp
We may have buffers with different encodings, that, in turn, may also
[features.git] / src / mathed / InsetMathHull.cpp
index 99d59b00b08a291bc29c97358345562387feaf75..d94d70b46f14b37aa3255c451d2e5af370ff6a13 100644 (file)
@@ -450,7 +450,9 @@ static docstring latexString(InsetMathHull const & inset)
        // in text mode (such as $\text{$\phi$}$) gets processed twice. The
        // first time as a whole, and the second time only the inner math.
        // In this last case inset.buffer() would be invalid.
-       static Encoding const * encoding = inset.buffer().language()->encoding();
+       static Encoding const * encoding = 0;
+       if (inset.isBufferValid())
+               encoding = &(inset.buffer().params().encoding());
        WriteStream wi(ls, false, true, false, encoding);
        inset.write(wi);
        return ls.str();