none
Changing system locale for non-unicode supported application RRS feed

  • Question

  • Hello,

    We have one application (Chinese), which requires system locale to be changed from English to Chinese.

    Is it possible to change System Locale (Language for non-unicode programs) with a script/GPO etc? OS is Windows 7 64-bit.

    Thank you already for help.


    Tuesday, May 17, 2011 1:26 PM

Answers

  • Hello everybody,

    I managed to resolve how to change System Locale (and other Regional Settings) without user interaction.

    First, create XML file like this. Save this to c:\temp or where ever you like:

    <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

    <!--User List-->

    <gs:UserList>
    <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true"/>
    </gs:UserList>

    <!-- This sets system locale to China -->
    <gs:SystemLocale Name="zh-CN" />
    </gs:GlobalizationServices>

     

    Next, execute following command with admin privileges:

    control.exe intl.cpl,,/f:"c:\temp\locale.xml"

    After restart, my System Locale was changed for all users to Chinise (Simplified, PRC)

    Thanks everyone for help!

     

    • Marked as answer by weedee Friday, May 20, 2011 12:50 PM
    Friday, May 20, 2011 12:50 PM

All replies

  • With a German UI what you are looking for might be "Regionen und Sprachen" (regions and languages), and the last tab "Verwaltung" (administration):  You can set the language for non-Unicode programs globally (for all accounts).

    With CHCP in a CMD-window I get 850, that's the normal "OEM codepage" for various European languages including German, and I could switch to 858 in console programs using the OEM codepage when I need the Euro symbol.  The corresponding "ANSI codepage" (ACP) would be 1252, it is for non-Unicode Windows applications.  

    Check out http://msdn.microsoft.com/en-us/library/ms682064(v=vs.85).aspx for details.

    Wednesday, May 18, 2011 3:33 AM
  • Hi,

    Sorry man, but I don't understand how I use CHCP utility to change my System Locale from English to Chinise.

    Wednesday, May 18, 2011 12:29 PM
  • Well, did you find the "region and language" part of the system control?  There are five choices for Chinese, e.g., "simplified mainland" or "traditional Macao".  Whatever you pick should arrange corresponding console (OEMCP) and non-Unicode windows (ACP) settings in the registry, you can check the effect with regedit (see the MSDN link in my first reply for the location of the registry keys).  
    Wednesday, May 18, 2011 12:42 PM
  • Hello again,

    I take a look at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage registry key and wrote down ACP and OEMCP values when System Locale was English. They were ACP 1252 and OEMCP 437.

    After I changed System Locale to Chinese (Simplified) from Regional Settings, same values were changed to ACP 936, OEMCP 936.

    Next, I attempted to change System Locale directly via registry without touching Regional Settings by changing ACP and OEMCP values to 936. After restart, I went to Reginal Settings and System Locale was still English.

     

    Thursday, May 19, 2011 6:39 AM
  • Hi,

    You may refer the following link to change the Non-Unicode language.

    http://technet.microsoft.com/en-us/library/cc721887(WS.10).aspx 


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Thursday, May 19, 2011 8:03 AM
    Moderator
  •  I attempted to change System Locale directly via registry without touching Regional Settings by changing ACP and OEMCP values to 936. After restart, I went to Reginal Settings and System Locale was still English

    Makes sense for me, the "region and language" setting covers many "NLS" registry entries.  If you use regedit to patch individual entries, in your example OEMCP and ACP, the reported overall setting stays as it was.   For my purposes only the code pages were important, other details like currency symbol, keyboard layout, sorting, time and date format, etc.  always worked "as is" for my German windows versions.

    Sadly on windows 7 home premium I can't install user interface language packs, that would require windows 7 ultimate.   If you are in the same position don't worry about it, your old non-Unicode applications should not be affected by new windows 7 tricks.  

    Thursday, May 19, 2011 7:45 PM
  • Hello everybody,

    I managed to resolve how to change System Locale (and other Regional Settings) without user interaction.

    First, create XML file like this. Save this to c:\temp or where ever you like:

    <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

    <!--User List-->

    <gs:UserList>
    <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true"/>
    </gs:UserList>

    <!-- This sets system locale to China -->
    <gs:SystemLocale Name="zh-CN" />
    </gs:GlobalizationServices>

     

    Next, execute following command with admin privileges:

    control.exe intl.cpl,,/f:"c:\temp\locale.xml"

    After restart, my System Locale was changed for all users to Chinise (Simplified, PRC)

    Thanks everyone for help!

     

    • Marked as answer by weedee Friday, May 20, 2011 12:50 PM
    Friday, May 20, 2011 12:50 PM
  • Hello Everyone,

    I wanted to change the language for Unicode programs to el-GR. (Greek). Used the following code. After running that , restarted the machine and checked. Still I see English is set in  language for Unicode programs.

    <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

    <!--User List-->

    <gs:UserList>
    <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true"/>
    </gs:UserList>

    <!-- This sets system locale to Greece -->
    <gs:SystemLocale Name="el-GR" />
    </gs:GlobalizationServices>

    Can any one have suggestions please.

    Sridhar

    Thursday, July 16, 2015 2:41 PM
  • hi Sridhar,

    for me your code Looks good maybe you have a typo in your commandline ? Are you able to Change any other Setting this way ?

    /oliver

    Saturday, August 29, 2015 8:48 PM
  • Hi,

    I am trying to run same script to change the system locale on remote computer. Have been struggling with it and noticed that if run the same command using powershell as administrator it works fine. However, if I try to run the script remotely on computer it is failing. Below is the command that I have added in my script to run.

    Invoke-Command -ComputerName $servername -scriptblock {control.exe "intl.cpl,,/f:`"c:\myregionalcfg.xml`""}

    Can someone suggest what I am missing.

    Tuesday, October 15, 2019 12:01 PM