Visual Studio 资源编辑器损坏了 UTF-8 编码的 rc 文件

Visual Studio Resource Editor corrupts rc files with UTF-8 encoding

Visual Studio 如果 .rc 文件在没有 UTF-8 BOM 的情况下保存,2019 和 2022 资源编辑器能够正确读取和显示 UTF-8 编码的 .rc 文件。 对它的主要要求,.rc文件必须包含有效的#pragma code_page.
示例:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(65001)

但是如果您对文本资源进行了一些更改并将结果保存回 .rc 文件,它将被损坏:

有没有一些方法可以在 Visual Studio 201922 资源编辑器中使用 UTF-8 c++ 资源而没有这个错误。

P.S.:

Microsoft 知道这个错误,但他们决定不修复它:

Thank you very much for your feedback. We've decided to take no action on this feedback at the time.
When working with Resource Compiler (.rc) source files, our suggestion has always been to use UTF-16 whenever resources contain strings that cannot be encoded as ASCII. Based on your replies, it looks like switching back to UTF-16 would unblock your experience with Resource Editor, with the caveat that GitHub won't treat .rc files as text.
While eventually we want to support UTF-8 text encodings for .rc files, we currently do not have plans for this work; and for this reason we're closing this issue as Won't Fix.

https://developercommunity.visualstudio.com/t/visualstudio-v1590-resource-editor-using-utf-8-bom/384705