Completion Menu Encoding
- PSCompletions uses the encoding returned by
$PSCompletions.menu.encodingto load and render the completion menu. - In most cases, it automatically selects a suitable locale-based encoding.
- You can run the following command to check which encoding is currently used by the menu:powershell
$PSCompletions.menu.encoding
If the following setting is enabled:
- Open
Control Panel>Region>Administrative - Click
Change system locale... - Check
Beta: Use Unicode UTF-8 for worldwide language support
- Open
Then
$PSCompletions.menu.encodingwill obtain a unifiedUTF-8encoding.However, in
Windows Terminal, usingUTF-8may cause Chinese characters in the completion menu to display incorrectly.In this case, you need to manually set the encoding used by the completion menu.
For example, for Simplified Chinese, you can use code page
936to obtain a suitable encoding:powershellImport-Module PSCompletions $PSCompletions.menu.encoding = [System.Text.Encoding]::GetEncoding(936)