如何更改 csharp 项目(visual studio/msbuild 机器)中的源文件编码?

编程入门 行业动态 更新时间:2024-10-28 13:15:07
本文介绍了如何更改 csharp 项目(visual studio/msbuild 机器)中的源文件编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法强制 VS 始终使用 Unicode,而不是奇怪的 ISO 东西?

Is there a way to force VS to use Unicode always, instead of weird ISO-something?

我正在 Vista(波兰语环境)上使用 Visual Studio 2008 开发一个 winapp csproject.当我在 Win Server 2003(英语语言环境)上构建项目时出现问题 - 然后波兰语变音符号消失了.

I'm working on a winapp csproject using Visual Studio 2008 on Vista (Polish locale). The problem appears when I build the project on Win Server 2003 (English locale) - then Polish diacritic is gone.

我调查了该问题是由不正确的源文件编码引起的.看起来源文件没有使用 UTF-8 编码.

I investigated that the issue is caused by improper source file encoding. It looks that source files aren't using UTF-8 encoding.

推荐答案

问题:由于我刚刚添加的国际字符,从命令行启动的编译器无法处理源文件.

Problem: Compiler launched from command line cannot process the source file because of international characters that I’ve just added.

解决方案:以UTF-8编码显式保存源文件以保留国际字符.

Solution: Save source file explicitly in UTF-8 encoding to preserve international characters.

如何:

在 Visual Studio 中打开有问题的文件.在文件菜单上单击高级保存选项"从编码"组合中选择Unicode (UTF-8 ..."点击确定.

你准备好了.承诺取悦构建服务器和等待绿色的团队其他成员.

You’re set. Commit to please the build server and rest of the team waiting for green.

这篇关于如何更改 csharp 项目(visual studio/msbuild 机器)中的源文件编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-31 02:08:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/793616.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:源文件   如何更改   机器   项目   csharp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!