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 for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 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.