]> git.lyx.org Git - features.git/commitdiff
Set the default locale at startup.
authorEnrico Forestieri <forenr@lyx.org>
Wed, 11 Jun 2014 17:08:44 +0000 (19:08 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 11 Jun 2014 17:08:44 +0000 (19:08 +0200)
On startup, the default locale is "C", meaning that all system
functions assume an ascii codeset. The environment's locale
settings should be selected by calling setlocale(LC_ALL,"").
This is done by Qt during the QCoreApplication initialization
but this inizialization is never performed for batch processing
and, as a result, LyX is not able to process files whose names
contain non-ascii characters. This is not an issue on Windows,
where the file names are always stored as UTF-16, so the call is
only performed for unix-like platforms (this also includes cygwin,
due to its own filenames management that allows using characters
which are forbidden to native programs).

src/support/os_cygwin.cpp
src/support/os_unix.cpp
status.21x

index 92cbf15fbb3c8075fbf7d1ff6487d2fff8e6d7f6..4179d491c300b3a108418eb46485ab0520b59e33 100644 (file)
@@ -215,6 +215,9 @@ void init(int argc, char * argv[])
        argc_ = argc;
        argv_ = argv;
 
+       // Set environment's default locale
+       setlocale(LC_ALL, "");
+
        // Make sure that the TEMP variable is set
        // and sync the Windows environment.
        setenv("TEMP", "/tmp", false);
index b85bdb20cd4788ec8dfbeeb762983db100404c52..03dfb381c22480c03d08fcfaac692bb7154d4007 100644 (file)
@@ -46,6 +46,9 @@ void init(int argc, char * argv[])
 {
        argc_ = argc;
        argv_ = argv;
+
+       // Set environment's default locale
+       setlocale(LC_ALL, "");
 }
 
 
index c86f5da929125145d67f3052ba4a6cb0cebcb298..b4501a6a31ea5b9a047d366a92262f1895145ba1 100644 (file)
@@ -79,6 +79,9 @@ What's new
 
 - Output arguments required by arguments with DefaultArg or PresetArg (bug 9128).
 
+- Fix export from command line when included files have names with non-ascii
+  characters.
+
 
 * LYX2LYX