mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-02 05:55:38 +00:00
Set the default locale at startup.
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).
This commit is contained in:
parent
970da7c5e2
commit
32e42f2f81
@ -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);
|
||||
|
@ -46,6 +46,9 @@ void init(int argc, char * argv[])
|
||||
{
|
||||
argc_ = argc;
|
||||
argv_ = argv;
|
||||
|
||||
// Set environment's default locale
|
||||
setlocale(LC_ALL, "");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user