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"; + } }