保存后,Vs2017(15.9.11)将编码从ANSI更改为UTF8 [英] Vs2017 (15.9.11) changes encoding from ANSI to UTF8 after save

查看:704
本文介绍了保存后,Vs2017(15.9.11)将编码从ANSI更改为UTF8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vs2017(15.9.11)在保存后将编码从ANSI更改为UTF8。


所有.cs文件都没有发生这种情况,但文件很少。


注意 - 我在Vs2015中尝试过相同的编码并没有改变。


你能否建议是否可以修改?


解决方案

嗨Rups,


感谢您在此发帖。


当Visual Studio保存文件时,它使用几个步骤来确定保存文件的最佳编码:


  1.   if .editorconfig指定文件的编码,它使用该编码
  2.  如果内容中的字符可以在打开文件的编码中表示,则使用相同的编码保存
  3.  否则,IDE要求编码以保存文件

当然,您可以在保存文件时更改高级保存选项窗口中的编码。 / p>

请选择.cs文件>>文件>>将文件另存为>>单击保存按钮旁边的下拉按钮



希望它可以帮到你。


最好的问候,


迪伦


Vs2017 (15.9.11) changes encoding from ANSI to UTF8 after save.

This is not happening for all .cs files but few files.

Note - I tried same in Vs2015 and encoding is not changing there.

Can you please suggest if any fix available ?

解决方案

Hi Rups,

Thank you for posting here.

When Visual Studio saves a file, it uses several steps to determine the best encoding to save the file:

  1.  If .editorconfig specifies an encoding for the file, it uses that encoding
  2.  If the characters in the content can be represented in the encoding the file was opened with, it saves with that same encoding
  3.  Otherwise, the IDE asks for the encoding to save the file

Of course,you can change the encoding in the advanced save option windows when you save file.

Please select the .cs file>> File>>save file as>>click drop-down button next to the save button

Hope it can help you.

Best Regards,

Dylan


这篇关于保存后,Vs2017(15.9.11)将编码从ANSI更改为UTF8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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