You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/apps/design/globalizing/use-utf8-code-page.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,27 @@
1
1
---
2
2
title: Use UTF-8 code pages in Windows apps
3
3
description: How to use UTF code pages in Windows apps.
4
-
ms.date: 06/21/2023
4
+
ms.date: 07/17/2025
5
5
ms.topic: how-to
6
6
---
7
7
8
8
# Use UTF-8 code pages in Windows apps
9
9
10
-
Use [UTF-8](http://www.utf-8.com/) character encoding for optimal compatibility between web apps and other \*nix-based platforms (Unix, Linux, and variants), minimize localization bugs, and reduce testing overhead.
10
+
Use Unicode Transformation Format 8-bit ([UTF-8](http://www.utf-8.com/)) character encoding to maximize compatibility between web apps and other *nix-based platforms (Unix, Linux, and variants), minimize localization bugs, and reduce testing overhead.
11
11
12
-
UTF-8 is the universal code page for internationalization and is able to encode the entire Unicode character set. It is used pervasively on the web, and is the default for *nix-based platforms.
12
+
UTF-8 is the universal code page for internationalization and is able to encode the entire Unicode character set. It is used extensively on the web and is the default encoding for both XML and*nix-based platforms.
13
13
14
14
## Set a process code page to UTF-8
15
15
16
-
As of Windows Version 1903 (May 2019 Update), you can use the ActiveCodePage property in the appxmanifest for packaged apps, or the fusion manifest for unpackaged apps, to force a process to use UTF-8 as the process code page.
16
+
As of Windows Version 1903 (May 2019 Update), you can specify the [activeCodePage](/windows/win32/sbscs/application-manifests#activecodepage) property in the appxmanifest for packaged apps (or the fusion manifest for unpackaged apps) to force a process to use UTF-8 as the process code page.
17
17
18
18
> [!NOTE]
19
-
> GDI doesn't currently support setting the ActiveCodePage property per process. Instead, GDI defaults to the active system codepage. To configure your app to render UTF-8 text via GDI, go to Windows **Settings** > **Time \& language** > **Language \& region** > **Administrative language settings** > **Change system locale**, and check **Beta: Use Unicode UTF-8 for worldwide language support**. Then reboot the PC for the change to take effect.
19
+
> Windows graphics device interface (GDI) doesn't currently support setting the activeCodePage property per process. Instead, GDI defaults to the active system codepage. To configure your app to render UTF-8 text via GDI, go to Windows **Settings** > **Time \& language** > **Language \& region** > **Administrative language settings** > **Change system locale**, and check **Beta: Use Unicode UTF-8 for worldwide language support**. Then reboot the PC for the change to take effect.
20
20
21
-
You can declare the ActiveCodePage property, and target/run on earlier Windows builds, but you must handle legacy code page detection and conversion as usual. With a minimum target version of Windows Version 1903, the process code page will always be UTF-8, so legacy code page detection and conversion can be avoided.
21
+
You can declare the activeCodePage property, and target/run on earlier Windows builds, but you must handle legacy code page detection and conversion as usual. With a minimum target version of Windows Version 1903, the process code page will always be UTF-8, so legacy code page detection and conversion can be avoided.
22
22
23
23
> [!NOTE]
24
-
> In UTF-8, an encoded character is represented by a sequence of 1 to 4 bytes. (See definition D92 in Chapter 3 of [The Unicode Standard](https://www.unicode.org/versions/latest/) for the formal specification.)
24
+
> In UTF-8, an encoded character is represented by a sequence of 1 to 4 bytes. (See [definition D92 in Chapter 3](https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G27817) of [The Unicode Standard](https://www.unicode.org/versions/latest/) for the formal specification.)
25
25
26
26
## Examples
27
27
@@ -39,7 +39,7 @@ You can declare the ActiveCodePage property, and target/run on earlier Windows b
39
39
<Applications>
40
40
<Application ...>
41
41
<uap7:Properties>
42
-
<uap8:ActiveCodePage>UTF-8</uap8:ActiveCodePage>
42
+
<uap8:activeCodePage>UTF-8</uap8:activeCodePage>
43
43
</uap7:Properties>
44
44
</Application>
45
45
</Applications>
@@ -80,7 +80,7 @@ Because Windows operates natively in UTF-16 (`WCHAR`), you might need to convert
80
80
Use `dwFlags` of either `0` or `MB_ERR_INVALID_CHARS` when using these functions with `CodePage` set to `CP_UTF8` (otherwise an `ERROR_INVALID_FLAGS` occurs).
81
81
82
82
> [!NOTE]
83
-
> `CP_ACP` equates to `CP_UTF8` only if running on Windows Version 1903 (May 2019 Update) or above and the ActiveCodePage property described above is set to UTF-8. Otherwise, it honors the legacy system code page. We recommend using `CP_UTF8` explicitly.
83
+
> `CP_ACP` equates to `CP_UTF8` only if running on Windows Version 1903 (May 2019 Update) or above and the activeCodePage property described above is set to UTF-8. Otherwise, it honors the legacy system code page. We recommend using `CP_UTF8` explicitly.
An Input Method Editor (IME) is a software component that enables a user to input text in a language that can't be represented easily on a standard QWERTY keyboard. This is typically due to the number of characters in the user's written language, such as the various East Asian languages.
14
+
An Input Method Editor (IME) is a software component that supports text input in edit controls for characters in languages that can't be represented easily on a standard QWERTY keyboard, such as those of various East Asian languages.
15
15
16
-
Instead of each single character appearing on a single keyboard key, a user types combinations of keys that are interpreted by the IME. The IME generates either the character that matches the set of key strokes or a list of candidate characters to choose from. The selected character is then inserted into the edit control that the user is interacting with.
16
+
Instead of each character appearing on a dedicated keyboard key, a combination of keystrokes are interpreted as a composite character by the IME. The IME generates the character that matches the set of key strokes (or provides a list of candidate characters to select from). The composite character is then inserted into the edit control.
17
17
18
18
> [!NOTE]
19
-
> IMEs can support both hardware keyboards and on-screen or touch keyboards.
19
+
> IMEs can support both hardware keyboards and on-screen keyboards (OSK) such as the touch keyboard.
20
20
21
21
Your app doesn't need to interact directly with the IME. The IME is built into the system, just as the touch keyboard is. If your app has text input, and you intend to support text input in languages that require an IME, you should test the end-to-end customer experience for text entry. This lets you fix any issues, such as adjusting your UI so it isn't occluded by the touch keyboard or IME candidate window.
22
22
@@ -40,10 +40,7 @@ A third-party IME must meet these requirements:
40
40
41
41
A third-party IME that doesn't meet these requirements is blocked from running.
42
42
43
-
> [!NOTE]
44
-
> Legacy custom IMEs can run in desktop apps, but are blocked in Windows apps.
45
-
46
-
Also, Windows Defender removes malicious IMEs from the system. Because of this, it's important that you familiarize yourself with the IME coding requirements. For more info, see [Input Method Editor (IME) requirements](input-method-editor-requirements.md).
43
+
Because Windows Defender removes malicious IMEs from the system, it's important to familiarize yourself with the IME coding requirements. For more info, see [Input Method Editor (IME) requirements](input-method-editor-requirements.md).
0 commit comments