- // XeTeX with TeX fonts is only safe with ASCII encoding,
- // but the "flavor" is not known in BufferParams::encoding().
- if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
+ // XeTeX with TeX fonts is only safe with ASCII encoding (see also #9740),
+ // Check here, because the "flavor" is not known in BufferParams::encoding()
+ // (power users can override this safety measure selecting "utf8-plain").
+ if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX)
+ && (runparams.encoding->name() != "utf8-plain"))