如何在csharp项目(visual studio / msbuild机器)中更改源文件编码? [英] how to change source file encoding in csharp project (visual studio / msbuild machine)?

查看:138
本文介绍了如何在csharp项目(visual studio / msbuild机器)中更改源文件编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



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

我正在使用Visual Studio 2008在winapp csproject上工作Vista(波兰语区域)。当我在Win Server 2003(英文语言环境)上构建项目时,出现问题 - 那么波兰语变音符已经消失了。



我调查问题是由不正确的源文件编码引起的。它看起来源文件不使用UTF-8编码。

解决方案

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



解决方案:以UTF-8编码明确保存源文件以保留国际字符。



如何:

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

你设置好了,请求构建服务器,等待绿色的团队的其他人。


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

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.

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.

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

How To:

* open the problematic file in Visual Studio.
* on the File menu click "Advanced Save Options"
* from "Encoding" combo select "Unicode (UTF-8 …"
* click OK.

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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆