How to set standard encoding in Visual Studio

Thomaschaaf picture Thomaschaaf · Mar 30, 2009 · Viewed 168k times · Source

I am searching for a way to setup Visual Studio so it always saves my files in UTF-8.

I have only found options to set this project wide. Is there a way to set it Visual Studio wide?

Answer

Samuel Meacham picture Samuel Meacham · Dec 9, 2009

Do you want the files to save as UTF-8 because you are using special characters that would be lost in ASCII encoding? If that's the case, then there is a VS2008 global setting in Tools > Options > Environment > Documents, named Save documents as Unicode when data cannot be saved in codepage. When this is enabled, VS2008 will save as Unicode if certain characters cannot be represented in the otherwise-default codepage.

Also, which files are not being saved as UTF-8? All of my .cs, .csproj, .sln, .config, .as*x, etc, all save as UTF-8 (with signature, the byte order marks), by default.