Skip to content

Completion Menu Encoding

  • PSCompletions uses the encoding returned by $PSCompletions.menu.encoding to 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:

    1. Open Control Panel > Region > Administrative
    2. Click Change system locale...
    3. Check Beta: Use Unicode UTF-8 for worldwide language support
  • Then $PSCompletions.menu.encoding will obtain a unified UTF-8 encoding.

  • However, in Windows Terminal, using UTF-8 may 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 936 to obtain a suitable encoding:

    powershell
    Import-Module PSCompletions
    $PSCompletions.menu.encoding = [System.Text.Encoding]::GetEncoding(936)