From 612e52b0932f00b529ff2e28a407e38e416b8832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Wed, 9 Jul 2008 07:21:02 +0000 Subject: [PATCH] Back to CJK sanity I: Fix bug 4698 and 4696. * lib/encodings: * src/support/docstream.h: - JIS is not a valid iconv name. Rename to ISO-2022-JP * src/output_latex.cpp: - fix wrong encoding switch. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25510 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/encodings | 2 +- src/output_latex.cpp | 2 +- src/support/docstream.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/encodings b/lib/encodings index 22236ab51e..ee65d183c3 100644 --- a/lib/encodings +++ b/lib/encodings @@ -150,7 +150,7 @@ Encoding gbk GBK GBK variable CJK End # For japanese -Encoding jis JIS JIS variable CJK +Encoding jis JIS ISO-2022-JP variable CJK End # For korean diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 89e0b3f8ca..3e4d299262 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -700,10 +700,10 @@ TeXOnePar(Buffer const & buf, // the inset, and we're using "auto" or "default" encoding, the encoding // should be set back to that local_font's encoding. if (nextpit == paragraphs.end() && runparams_in.local_font != 0 + && runparams_in.encoding != runparams_in.local_font->language()->encoding() && (bparams.inputenc == "auto" || bparams.inputenc == "default")) { runparams_in.encoding = runparams_in.local_font->language()->encoding(); os << setEncoding(runparams_in.encoding->iconvName()); - } // Otherwise, the current encoding should be set for the next paragraph. else diff --git a/src/support/docstream.cpp b/src/support/docstream.cpp index df3d031a16..7777d13315 100644 --- a/src/support/docstream.cpp +++ b/src/support/docstream.cpp @@ -220,14 +220,14 @@ protected: encoding_ == "GB" || encoding_ == "EUC-TW") return 4; - else if (encoding_ == "EUC-JP") + else if (encoding_ == "EUC-JP" || + encoding_ == "ISO-2022-JP") return 3; else if (encoding_ == "BIG5" || encoding_ == "EUC-KR" || encoding_ == "EUC-CN" || encoding_ == "SJIS" || - encoding_ == "GBK" || - encoding_ == "JIS" ) + encoding_ == "GBK") return 2; else return 1;