From 67dd94913027c00abc44faf25e1e785c0f69d194 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 29 Dec 2006 09:24:18 +0000 Subject: [PATCH] Fix LaTeX generation of files with inputenc == default. See the patch itself for further comments. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16421 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/FORMAT | 5 +++-- src/bufferparams.C | 13 ++++++++++--- src/bufferparams.h | 5 ++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index e585c847c6..75b69a8adc 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -78,8 +78,9 @@ LyX file-format changes encoding of the LyX file: \inputencoding LyX file encoding - auto as determined by the document language - default latin1 + auto as determined by the document language(s) + default unspecified 8bit (treated as latin1 internally, + see comment in bufferparams.h) everything else as determined by \inputencoding 2006-07-03 Georg Baum diff --git a/src/bufferparams.C b/src/bufferparams.C index d81ca7036d..6c6ebacf31 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -1468,11 +1468,18 @@ Encoding const & BufferParams::encoding() const { if (inputenc == "auto") return *(language->encoding()); - Encoding const * const enc = encodings.getFromLaTeXName(inputenc); + Encoding const * const enc = (inputenc == "default") ? + encodings.getFromLyXName("iso8859-1") : + encodings.getFromLaTeXName(inputenc); if (enc) return *enc; - lyxerr << "Unknown inputenc value `" << inputenc - << "'. Using `auto' instead." << endl; + if (inputenc == "default") + lyxerr << "Could not find iso8859-1 encoding for inputenc " + "value `default'. Using inputenc `auto' instead." + << endl; + else + lyxerr << "Unknown inputenc value `" << inputenc + << "'. Using `auto' instead." << endl; return *(language->encoding()); } diff --git a/src/bufferparams.h b/src/bufferparams.h index 036a8efbca..28599a93ac 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -180,7 +180,10 @@ public: * The input encoding for LaTeX. This can be one of * - auto: find out the input encoding from the used languages * - default: Don't load the inputenc package and hope that it will - * work (unlikely) + * work (unlikely). The encoding is an unspecified 8bit encoding, + * the interpretation is up to the LaTeX compiler. Because we need + * a rule how to create this from our internal UCS4 encoded + * document contents we treat this as latin1 internally. * - any encoding supported by the inputenc package * The encoding of the LyX file is always utf8 and has nothing to * do with this setting. -- 2.39.2