windows terminal中如何更改编码格式为utf-8?

Ludwig Wittgenstein 20 Reputation points
2023-06-05T12:55:01.1633333+00:00

windows terminal的默认编码格式为gbk,编译一些utf-8文件的时候会出现乱码,如何把windows terminal的默认编码格式改为utf-8?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,075 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,915 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,786 Reputation points
    2023-06-05T15:00:12.3633333+00:00

    What code page is being used now?

    You can try using code page 65001 (utf-8), or 936 (gb2312), or 20936 (x-cp20936). There are other simplified Chinese code pages, too.

    https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers

    https://en.wikipedia.org/wiki/Code_page_936_(Microsoft_Windows)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.