Search code examples
winapilocalecodepages

Must Windows system locale be system wide?


hello, all. Must Windows system locale(or say, system codepage, 1252, 936, 950 etc) be system wide? You know, in Windows 2000 ~ Windows 7, changing the system codepage in Control Panel requires a reboot to take effect.

I'd like to know whether I can have per-logon-session locale setting or even per-process locale setting? That will ease debugging program running with different locale.

BTW: I found GetCPInfo() Win32 API but no corresponding SetCPInfo, sigh.


Solution

  • Yes, the system locale is the whole system, but users and processes/threads can change their own locale. The thread local can be set using SetThreadLocale(). Anything else is not in the remit of your program to change.