mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Force encoding switch when switching from/to CJK, even if we use a customized encoding (#8558)
This commit is contained in:
parent
a78bed06eb
commit
a8a2bd463c
@ -1196,8 +1196,12 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
|
||||
{
|
||||
Encoding const & oldEnc = *runparams.encoding;
|
||||
bool moving_arg = runparams.moving_arg;
|
||||
if (!force && ((bparams.inputenc != "auto" && bparams.inputenc != "default")
|
||||
|| moving_arg))
|
||||
// If we switch from/to CJK, we need to switch anyway, despite custom inputenc
|
||||
bool const from_to_cjk =
|
||||
(oldEnc.package() == Encoding::CJK && newEnc.package() != Encoding::CJK)
|
||||
|| (oldEnc.package() != Encoding::CJK && newEnc.package() == Encoding::CJK);
|
||||
if (!force && !from_to_cjk
|
||||
&& ((bparams.inputenc != "auto" && bparams.inputenc != "default") || moving_arg))
|
||||
return make_pair(false, 0);
|
||||
|
||||
// Do nothing if the encoding is unchanged.
|
||||
|
Loading…
Reference in New Issue
Block a user