]> git.lyx.org Git - features.git/commitdiff
Write fixed encoding to LyX file (bug #9178)
authorGeorg Baum <baum@lyx.org>
Sat, 14 Feb 2015 09:45:13 +0000 (10:45 +0100)
committerGeorg Baum <baum@lyx.org>
Sat, 14 Feb 2015 09:45:13 +0000 (10:45 +0100)
If the user gave the -fixedenc argument to tex2lyx then set that encoding as
LaTeX input encoding in the generated LyX file. Otherwise, included .bib files
could be interpreted using a wrong encoding.

src/tex2lyx/Preamble.h
src/tex2lyx/tex2lyx.cpp
status.21x

index 91f3a4882f969896bf5607de1d871f646b7abbdc..ae5886e08e854c7b92fb3b6d38f46c79c7c5e72a 100644 (file)
@@ -37,6 +37,8 @@ public:
        ///
        std::string inputencoding() const { return h_inputencoding; }
        ///
+       void setInputencoding(std::string const & e) { h_inputencoding = e; }
+       ///
        std::string notefontcolor() const { return h_notefontcolor; }
        ///
        bool refstyle() const { return h_use_refstyle; }
index 9e3257cf7375c05f67d6243112bb94c7518d9934..c3cf99acb68d8cc722e737f554e17403bcff6490 100644 (file)
@@ -788,14 +788,6 @@ bool roundtripMode()
 }
 
 
-string fixedEncoding()
-{
-       if (fixed_encoding)
-               return default_encoding;
-       return "";
-}
-
-
 namespace {
 
 /*!
@@ -1064,6 +1056,8 @@ int main(int argc, char * argv[])
                if (!enc)
                        error_message("Unknown LaTeX encoding `" + default_encoding + "'");
                default_encoding = enc->iconvName();
+               if (fixed_encoding)
+                       preamble.setInputencoding(enc->name());
        }
 
        // Load the layouts
index a8da9d48e0870ce64a829dd90a830ea4f496d6e1..8470f2ecbf51477502590424872003bc5293897e 100644 (file)
@@ -102,6 +102,8 @@ What's new
 
 * TEX2LYX
 
+- Write fixed encoding to LyX file if -fixedenc was given (bug 9178).
+