]> git.lyx.org Git - features.git/commitdiff
Fix LaTeX generation of files with inputenc == default.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 29 Dec 2006 09:24:18 +0000 (09:24 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 29 Dec 2006 09:24:18 +0000 (09:24 +0000)
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
src/bufferparams.C
src/bufferparams.h

index e585c847c65933adcb48d0b5d012f02c5fa84853..75b69a8adc1711cf4c0466d65849ae0f38b07d77 100644 (file)
@@ -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  <Georg.Baum@post.rwth-aachen.de>
index d81ca7036d81f958b96c16af00d9c1988c706a5c..6c6ebacf311ee3d11196d18e7b4ca0faa61c92e8 100644 (file)
@@ -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());
 }
 
index 036a8efbca8b1ac0e6b62fc31cb466cfb0c89091..28599a93ac10b78bb544a08ee53d2e582676013e 100644 (file)
@@ -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.