Stop visual studio from changing file encoding on save
I am using Visual Studio Express 2012 for Web to edit some ANSI encoded html and javascript files. When I save the changes VS is changing the encoding of the files to UTF-8 with BOM.
Visual Studio issues the following warning:
The character encoding for the file file.htm has changed. Your source control provider may have problems managing files with this type of encoding. For example, if you save an ANSI-encoded file as UTF-8 you may not be able to merge or show differences.
Is there a way to make Visual Studio save files without changing encoding?
In your HTML files, put the following <meta>
tag between the <head>
and </head>
tags:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
Next, save the files—Visual Studio will detect the <meta>
tag and save the files in Windows-1252 (ANSI) encoding.
下一篇: 在保存时停止更改文件编码的视觉工作室