I'm using Microsoft Visual Studio Express 2012 for Web. It seems that every file which I open with it gets encoded into UTF-8. For most files which are going to be web-facing, that's fine. However, I have files in my projects that are specifically for build purposes (e.g., .bat files), which must be encoded in ANSI.
Are there any configuration settings in VS to either designate on a per file or a per extension basis the encoding? Or, if not specify the encoding, at least disable the auto-conversion to UTF-8?
Open the problematic file in Visual Studio and...
File
menu, click Advanced Save Options
.Encoding
dropdown, select Unicode (UTF-8 …
or the encoding you require.OK
.Also see: how to change source file encoding in csharp project (visual studio / msbuild machine)?