mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
- set locale to US English UTF-8 for POSIX targets
Locale-dependent standard library functions didn't treat UTF-8 strings correctly, e.g. iswalpha() returns 0 for any non-latin letter The same function from MSVC runtime classifies such characters as alphabetic even with C locale https://forum.zdoom.org/viewtopic.php?t=65641&start=18#p1115930
This commit is contained in:
parent
1595bf30c6
commit
80ef9ca686
2 changed files with 4 additions and 4 deletions
|
@ -199,8 +199,8 @@ int OriginalMain(int argc, char** argv)
|
||||||
// Set LC_NUMERIC environment variable in case some library decides to
|
// Set LC_NUMERIC environment variable in case some library decides to
|
||||||
// clear the setlocale call at least this will be correct.
|
// clear the setlocale call at least this will be correct.
|
||||||
// Note that the LANG environment variable is overridden by LC_*
|
// Note that the LANG environment variable is overridden by LC_*
|
||||||
setenv("LC_NUMERIC", "C", 1);
|
setenv("LC_NUMERIC", "en_US.UTF-8", 1);
|
||||||
setlocale(LC_ALL, "C");
|
setlocale(LC_ALL, "en_US.UTF-8");
|
||||||
|
|
||||||
// Set reasonable default values for video settings
|
// Set reasonable default values for video settings
|
||||||
|
|
||||||
|
|
|
@ -170,9 +170,9 @@ int main (int argc, char **argv)
|
||||||
// Set LC_NUMERIC environment variable in case some library decides to
|
// Set LC_NUMERIC environment variable in case some library decides to
|
||||||
// clear the setlocale call at least this will be correct.
|
// clear the setlocale call at least this will be correct.
|
||||||
// Note that the LANG environment variable is overridden by LC_*
|
// Note that the LANG environment variable is overridden by LC_*
|
||||||
setenv ("LC_NUMERIC", "C", 1);
|
setenv ("LC_NUMERIC", "en_US.UTF-8", 1);
|
||||||
|
|
||||||
setlocale (LC_ALL, "C");
|
setlocale (LC_ALL, "en_US.UTF-8");
|
||||||
|
|
||||||
if (SDL_Init (0) < 0)
|
if (SDL_Init (0) < 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue