Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4647328
By: tml1024

There are two issues here that you need to understand:

Firstly the setlocale() function in the Microsoft C library does not accept
locale strings in the same syntax as its counterparts on Linux (and (most?)
POSIX systems in general). It does not use the ISO639 and ISO3166 language and
country codes. Instead it uses a syntax like "Swedish_Finland.1252", i.e. the
name of the language in English, followed by an underscore and the name of the
country in English (and optionally followed by a period and the code page).
In your case setlocale(LC_ALL, "Japanese_Japan") should do the trick.

The C library's locale affects things like whether to use decimal comma or 
point,
names of weekdays as produced by strftime() etc.

The second issue is that even if you manage to set the C library's locale with
setlocale(), that does not affect the locale of the thread as known to the 
Windows
kernel. To do that you need to call SetThreadLocale(). And of course, this again
uses a different form of locale identifier, a LCID. (This affects the current
thread only, so if you call this you better do it early in the lifetime of the
process if you intend to start more threads.)

The gettext library uses the GetThreadLocale() call to find out what language
to use.

Note that the gettext library first looks for LC_ALL and LANG environment 
variables,
so to affect just gettext, it is enough to set one of these environment 
variables.
Not that unlike on POSIX systems, these environment variables have no effect
on the C library, though.

The thread locale affects locale-specific things in the Win32 API, but not the
C library.

Check out this test program: http://tml.pp.fi/localetest.c which should show
all the above aspects in great detail.

--tml


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=74807

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users

Reply via email to