]> git.lyx.org Git - lyx.git/blobdiff - src/DocIterator.cpp
Change python run time detection to privilege python 3 over python 2.
[lyx.git] / src / DocIterator.cpp
index 64dfd54af555a7c2ce4d9c5fa673d6df7bf71f8c..d14e0b32ab27090c96ce2a57f1955e9731f1837e 100644 (file)
@@ -738,6 +738,10 @@ Encoding const * DocIterator::getEncoding() const
        if (bp.useNonTeXFonts)
                return encodings.fromLyXName("utf8-plain");
 
+       // With platex, we don't switch encodings (not even if forced).
+       if (bp.encoding().package() == Encoding::japanese)
+               return &bp.encoding();
+
        CursorSlice const & sl = innerTextSlice();
        Text const & text = *sl.text();
        Language const * lang =
@@ -745,7 +749,7 @@ Encoding const * DocIterator::getEncoding() const
                                                                                  text.outerFont(sl.pit())).language();
        // If we have a custom encoding for the buffer, we don't switch
        // encodings (see output_latex::switchEncoding())
-       bool const customenc = bp.inputenc != "auto" && bp.inputenc != "default";
+       bool const customenc = bp.inputenc != "auto-legacy" && bp.inputenc != "auto-legacy-plain";
        Encoding const * enc = customenc ? &bp.encoding() : lang->encoding();
 
        // Some insets force specific encodings sometimes (e.g., listings in
@@ -777,7 +781,7 @@ Encoding const * DocIterator::getEncoding() const
                                                                                                                   otext.outerFont(slices_[i].pit())).language();
                        // Again, if we have a custom encoding, this is used
                        // instead of the language's.
-                       Encoding const * oenc = customenc 
+                       Encoding const * oenc = customenc
                                                                        ? &bp.encoding() : olang->encoding();
                        if (olang->encoding()->name() != "inherit")
                                return oenc;