导航

CP_ACP vs CP_THREAD_ACP

Posted on 2014-04-15 14:21  littledot  阅读(458)  评论(0编辑  收藏  举报

Background:
Windows uses a number of locales and language settings as described on
the following page:
http://msdn.microsoft.com/en-us/library/dd319088(v=VS.85).aspx

The relevant ones are Language for non-Unicode programs (System
Locale), Standards and Formats (User Locale) and Thread Locale. The
System Locale defines which code page is used by the system for narrow
chars, and is set by the user system-wide. The User Locale is for
formatting numbers and sorting and is set by the user system-wide. The
Thread Locale is also for formatting numbers and sorting, is
per-thread, and defaults to the User Locale but can be changed by the
program; however it is recommended in a number of places not to touch
it (although the exact reasons seem vague, apparently it can have
surprising effects).

CP_ACP gives the System Locale code page. CP_THREAD_ACP gives the
Thread Locale code page which is rather a strange item considering
that the Thread Locale isn't meant for code pages at all!

GetSystemDefaultLCID

GetUserDefaultLCID

GetThreadLocale