From: Günter Milde Date: Sun, 3 Feb 2019 21:04:17 +0000 (+0100) Subject: Prevent fallback to "utf8" if "inputenc" package is not loaded. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e83bbca9d9ca3413bfd712f56ba0393fe0ccc171;p=features.git Prevent fallback to "utf8" if "inputenc" package is not loaded. Since April 2018, pdflatex falls back to input-encoding utf8 if it does not detect an input encoding setting. https://www.latex-project.org/news/latex2e-news/ltnews28.pdf This leads to failure with CJK legacy encodings and may not be what you want if selecting "Language Default (no inputenc)" as document input-encoding. --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 57c75762ed..4295954911 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -3256,6 +3256,10 @@ void BufferParams::writeEncodingPreamble(otexstream & os, case Encoding::none: case Encoding::CJK: case Encoding::japanese: + if (encoding().iconvName() != "UTF-8") + // don't default to [utf8]{inputenc} with TeXLive >= 18 + os << "\\ifdefined\\UseRawInputEncoding\n" + << " \\UseRawInputEncoding\\fi\n"; break; case Encoding::inputenc: // do not load inputenc if japanese is used @@ -3272,6 +3276,11 @@ void BufferParams::writeEncodingPreamble(otexstream & os, break; } } + if (inputenc == "default" or features.isRequired("japanese")) { + // don't default to [utf8]{inputenc} with TeXLive >= 18 + os << "\\ifdefined\\UseRawInputEncoding\n"; + os << " \\UseRawInputEncoding\\fi\n"; + } }