This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows


On 02/04/2019 21:57, Владимир Мартьянов wrote:
I'm able to use results from setlocale(), but how can the user
influenсe the result of setlocale?
I wrote i simple program to display it's result:
void main(int argc, char* argv[])
{
     printf("%s\n", setlocale(LC_ALL, 0));
}
Then I run it from Cygwin console:
$ LC_ALL=en_US /cygdrive/c/Programming/Test/Debug/test.exe
C
$ LC_ALL=de_DE /cygdrive/c/Programming/Test/Debug/test.exe
C

Changing env. var doesn't affect setlocale() result.

This test program isn't correct. You must first call setlocale(LC_ALL, "") to change the locale from the default "C" locale.

See:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/setlocale.html
http://man7.org/linux/man-pages/man3/setlocale.3.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]