tags:

views:

404

answers:

2

When launching a process with CreateProcessW(), is it possible to have the process created with a different MBCP locale/codepage then the one that is configured as the system-wide default code page? In the target process, this should have the same effect as calling _setmbcp().

The target process is not a unicode-enabled and uses a plain main(int argc, char **argv) entry point. I would like to be able to select the code page to which unicode arguments passed to CreateProcessW() are converted to be different from the system's default codepage for non-unicode programs.

+1  A: 

I believe (and it's been a long time since I've had to know this) the child process inherits the locale of the parent process (or thread therein) -- have you tried switching the thread locale, launching your process (and switching back)?

Rowland Shaw
This sounds like a good plan... I'll give it a try
VoidPointer
+1  A: 

I just came accross a Microsoft utility: AppLocale, which seems to address just that need...

pascal