Programmatically change the default code page in Windows XP? (from Delphi)

Posted by Duncan on Stack Overflow See other posts from Stack Overflow or by Duncan
Published on 2010-06-09T16:14:50Z Indexed on 2010/06/09 18:02 UTC
Read the original article Hit count: 562

Filed under:
|
|

Could anyone advise how to programmatically change the default Windows XP code page (I'm doing this from Delphi)? (This would be the equivalent of going into Control Panel -> Regional Settings -> Language for non-Unicode applications).

In this case, I want to switch to Chinese (PRC) and so am writing to the following registry strings: HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ ACP=936 MACCP=10008 OEMCP=936

(Which is exactly what changing the non-Unicode codepage drop down in Control Panel does). There must be another setting which I need to change - and I'd prefer to use a Win API call (if available) rather than writing to the registry myself.

I've also tried setting HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language\ Default=0804 (Chinese PRC) to no avail.

I don't want to change the 'locale' per se as this will also change time / date settings, separators, etc. etc.

This is because I'm using an ANSI application that needs to render Chinese characters, and I'm writing a tool to automatically switch the system show the characters (while leaving other aspects of the UI intact).

Thanks!

Duncan

© Stack Overflow or respective owner

Related posts about delphi

Related posts about localization