大网数据广告活动
启动与系统组件

Half-width and full-width Japanese characters are treated as different characters

· 52CE 我爱测

This article resolves a problem that prevents certain half-width and full-width Katakana and Hiragana characters that have a consonant mark from being compared correctly by .NET Framework 4.x applications.

This article helps you resolve a problem that occurs when .NET Framework 4.x applications compare Japanese strings.

Applies to:   Windows 10 version 2004, Windows 10 version 20H2, Windows 10 version 21H1, Windows 10 version 21H2, Windows 10 version 22H2

Symptoms

Certain Japanese half-width and full-width Katakana and Hiragana characters that have a consonant mark aren't interpreted as the same character. When you use the CompareInfo.IndexOf method and the IgnoreKanaType or IgnoreWidth options as CompareOptions to make a comparison, these characters are evaluated as different because of an issue in the sorting rule.

Cause

Starting in version 2004, Windows 10 updated the version of National Language Support (NLS) to 6.3 and added support for Arabic and Hebrew. This addition affects the rules for sorting Japanese string comparisons that use NLS so that the comparisons will produce different results.

Workaround

Warning: Serious problems might occur if you modify the registry incorrectly. These problems could cause you to have to reinstall the operating system or even prevent your machine from starting. Microsoft can't guarantee that these problems can be solved. Before you modify it, back up the registry for restoration in case problems occur. Modify the registry at your own risk.

Workaround 1

Revert the NLS sorting rule to version 6.2. This version is used in Windows 10, version 1909 and earlier versions. When you have to share data between systems, consider applying the workaround consistently. If you use this workaround, do sufficient testing and evaluations to mitigate problems that are caused by different sorting rule versions on multiple systems.

To use this workaround, follow these steps:

  1. Open a Command Prompt window (cmd.exe) as an administrator.

  2. Run the following command:

    reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Sorting\Versions /ve /d 0006020F /f

  3. Restart the computer or processes to see the full effect.

Important: If you haven't installed KB4586853 or a later update on the computer, setting an invalid value in this registry entry might prevent the computer from starting.

Workaround 2

Set the NLS sorting rule to version 6.4. This version is used in Windows 11. To do this, you must apply KB5014023 or a later update, and upgrade the version to version 1741 or a later version. In this case, version 22H2 is already applied and doesn't have to be updated.

  1. Apply KB5014023 or a later update for Windows 10 versions 2004, 20H2, 21H1, and 21H2.

  2. Open the Command Prompt window (cmd.exe) as an administrator.

  3. Run the following command:

    reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Sorting\Versions /ve /d 00060403 /f

  4. Restart the computer or processes to see the full effect.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 06/11/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。