← All needs

Windows 11 context menu "Open with Code" shows garbled title on zh-CN systems (code_explorer_command_x64.dll)

**Type**: Bug ### What happened On Windows 11 with a Chinese (zh-CN) system locale, the **"Open with Code"** entry that VS Code registers in the modern File Explorer context menu renders as **garbled text** instead of a readable label. The affected entry is the one registered by the MSIX sparse package `Microsoft.VisualStudioCode_*_neutral__8wekyb3d8bbwe`, CLSID `{1C6DF0C0-192A-4451-BE36-6A59A86A692E}`, implemented by `code_explorer_command_x64.dll`. Successive right-clicks produce **different** garbage each time, e.g.: - `□□□脌眏擗□€毒罙£` - `胯除ij剉伞¤昰毒畾ξ` - `□F□胯除英?□o□毒畾ζ` - `□2□2胯赊芾敕□2毒畾ξ` The instability suggests an uninitialized buffer / wrong length calculation rather than a simple wrong-codepage conversion. ### What did you expect The entry should read `通过 Code 打开` (the value stored in the registry), or fall back to `Open with Code`. ### Reproduction steps 1. Windows 11 (22621), system locale zh-CN, system ANSI code page 936 2. Install VS Code 1.142.0 (User Setup) to a custom directory, e.g. `D:\Microsoft VS Code` 3. Right-click any file in File Explorer 4. Look at the VS Code entry in the Windows 11 modern context menu ### Additional findings Disassembling `code_explorer_command_x64.dll` reveals the strings `Software\Classes\VSCodeContextMenu`, `Title` and `UnExpected Title`, so the title is read from: ``` HKEY_CURRENT_USER\Software\Classes\VSCodeContextMenu Title = 通过 Code 打开 ``` The stored value is correct — verified at byte level (UTF-16LE): ``` 1A 90 C7 8F 20 00 43 00 6F 00 64 00 65 00 20 00 53 62 00 5F 00 ... = "通过 Code 打开" ``` Already ruled out: - **Not a wrong value or wrong value type.** Tried both `REG_SZ` and `REG_EXPAND_SZ`, identical result. - **Not a UTF-8 beta issue.** System ANSI code page is 936 (GBK); "Beta: Use Unicode UTF-8 for worldwide language support" is OFF. - **Not a broken installation.** Reproduced after a clean reinstall of 1.142.0 and after re-registering the sparse package. - **Not a font problem.** Every other context menu entry (WPS, Bandizip, Huorong, ChatGPT) renders Chinese correctly. - **Not an encoding-only problem.** Setting `Title` to a pure ASCII string (`Open with Code`) makes the entry **disappear entirely** (empty title), so the read path is broken beyond decoding. Environment details: | Item | Value | |---|---| | VS Code | 1.142.0, User Setup, install dir `D:\Microsoft VS Code` | | OS | Windows 11 Pro 22621 | | System locale | zh-CN, ACP 936 | | Package | `Microsoft.VisualStudioCode_1.0.142.0_neutral__8wekyb3d8bbwe` | | DLL | `code_explorer_command_x64.dll` 1.142.0, Authenticode signature valid (Microsoft Corporation) | ### Workaround Blocking the CLSID hides the broken entry (and loses the feature): ``` HKCU\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked {1C6DF0C0-192A-4451-BE36-6A59A86A692E} = "" ``` Alternatively, a plain shell verb registered under `HKCU\Software\Classes\*\shell\...` displays the Chinese title correctly, which confirms the problem is inside the IExplorerCommand implementation rather than in the OS or the font stack.