简体   繁体   English

以正确的编码生成 .resx 资源文件

[英]Generating .resx resource files in the correct encoding

I know I can change a resource file's encoding in the Properties tool window (eg to Unicode/utf-16), but this only sets the it for the existing file.我知道我可以在“属性”工具窗口中更改资源文件的编码(例如更改为 Unicode/utf-16),但这只会为现有文件设置它。

Can I get Visual Studio's Resource Generator (resgen.exe) to output files of a specific encoding in the first place, so that I don't need to change the encoding type every time I add, remove or update an entry in the file using the resource editor, or do I need to add a pre-build event command in the project properties?我是否可以首先使用 Visual Studio 的资源生成器 (resgen.exe) 来输出特定编码的文件,以便每次添加、删除或更新文件中的条目时都不需要更改编码类型使用资源编辑器,还是我需要在项目属性中添加预构建事件命令?

It turns out I was over-complicating matters, I opted to use the UTF-16-to-UTF-8 character converter instead.事实证明我把事情复杂化了,我选择使用UTF-16-to-UTF-8 字符转换器

This seems to be enough for my needs.这似乎足以满足我的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM