3

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?

Justin
  • 839
  • 1
  • 16
  • 24

1 Answers1

2

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.

Jared
  • 50
  • 8
  • 5
    This actually occurs more widely than the original question implies. That is to say, not only to html and javascript. Is there a more basic way to change this behavior? (I am having this issue in SSIS (XML under the hood) – Thronk Feb 26 '14 at 15:48