]> git.lyx.org Git - features.git/commitdiff
Write fixed encoding to LyX file (bug #9178)
authorGeorg Baum <baum@lyx.org>
Mon, 29 Dec 2014 21:29:20 +0000 (22:29 +0100)
committerGeorg Baum <baum@lyx.org>
Mon, 29 Dec 2014 21:29:20 +0000 (22:29 +0100)
If the user gave the -fixednec 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

index 3216c3cc6d697edab7c766bed8a293903af427cb..a0e5198d73682c659b5e21ca91d9573475ec9834 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 2ef209fc42305fc03731aa0a84da5197c6637535..e4c26603b1798e1ee0031754ba15e0b67870ccac 100644 (file)
@@ -789,14 +789,6 @@ bool roundtripMode()
 }
 
 
-string fixedEncoding()
-{
-       if (fixed_encoding)
-               return default_encoding;
-       return "";
-}
-
-
 namespace {
 
 /*!
@@ -1065,6 +1057,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