]> git.lyx.org Git - features.git/commitdiff
fix problem with non-recognized utf8 encoding that lead to broken .lyx
authorAndré Pönitz <poenitz@gmx.net>
Sat, 11 Oct 2008 16:07:14 +0000 (16:07 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 11 Oct 2008 16:07:14 +0000 (16:07 +0000)
files

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26844 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/preamble.cpp

index f679ea2170d5fe5204a4424f18b55ee44ac191e5..62dd2abb491dee139071574ec1488661d72227bb 100644 (file)
@@ -329,15 +329,17 @@ void handle_package(string const & name, string const & opts,
                // only set when there is not more than one inputenc option
                // therefore check for the "," character
                // also only set when there is not more then one babel language option
-               if (opts.find(",") == string::npos && one_language == true)
+               if (opts.find(",") == string::npos && one_language == true) {
                        if (opts == "ascii")
                                //change ascii to auto to be in the unicode range, see
                                //http://bugzilla.lyx.org/show_bug.cgi?id=4719
                                h_inputencoding = "auto";
-                       else
+                       else if (!opts.empty())
                                h_inputencoding = opts;
+               }
                options.clear();
        }
+
        else if (name == "makeidx")
                ; // ignore this
 
@@ -666,6 +668,10 @@ void parse_preamble(Parser & p, ostream & os,
                        }
                }
 
+               else if (t.cs() == "inputencoding") {
+                       h_inputencoding = p.getArg('{','}');
+               }
+
                else if (t.cs() == "newenvironment") {
                        string const name = p.getArg('{', '}');
                        ostringstream ss;