Programmatically Enabling/Disabling Use Unicode UTF-8 Worldwide Language Support in Windows 10 & 11
In this article, we will discuss how to programmatically enable or disable the "Use Unicode UTF-8 for worldwide language support" feature in Windows 10 and 11. This option is available in the intl.cpl settings page, and it can be enabled or disabled using various programming languages and tools.
What is the "Use Unicode UTF-8 for worldwide language support" feature?
The "Use Unicode UTF-8 for worldwide language support" feature is a Windows setting that enables the use of the UTF-8 character encoding as the default system code page. This option is useful for applications that require Unicode support and want to use a single character encoding for all languages and scripts. By enabling this feature, developers can ensure that their applications are compatible with a wide range of languages and scripts, including non-Latin alphabets and special characters.
How to enable or disable the feature programmatically?
There are several ways to enable or disable the "Use Unicode UTF-8 for worldwide language support" feature programmatically. Here are some examples using different programming languages and tools:
PowerShell
Set-WinSystemLocale -SystemLocale en-US.UTF-8
Command Prompt
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage" /v ACP /t REG_SZ /d 65001 /f
C#
using Microsoft.Win32;
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Nls\CodePage", true);
key.SetValue("ACP", 65001, RegistryValueKind.String);
key.Close();
Python
import winreg
key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Control\Nls\CodePage")
winreg.SetValueEx(key, "ACP", 0, winreg.REG_SZ, "65001")
key.Close()
Key concepts
Here are some key concepts to keep in mind when enabling or disabling the "Use Unicode UTF-8 for worldwide language support" feature programmatically:
- The feature is controlled by the
ACP(ANSI Code Page) value in theHKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePageregistry key. - The value data for the
ACPkey should be set to65001to enable UTF-8 support, or1252to disable it. - The change takes effect immediately and does not require a reboot.
- The feature can be enabled or disabled using various programming languages and tools, such as PowerShell, Command Prompt, C#, Python, and others.
In this article, we have discussed how to programmatically enable or disable the "Use Unicode UTF-8 for worldwide language support" feature in Windows 10 and 11. We have covered the key concepts and provided examples using different programming languages and tools. By enabling this feature, developers can ensure that their applications are compatible with a wide range of languages and scripts, including non-Latin alphabets and special characters.