sesame
sesame

Reputation: 825

How to set default encoding of source file to UTF-8 in VS.NET 2005

I use Chinese in my comments and configs. And after I auto merge and check in source files, they become messy codes.

I guess the reason is TFS merge them by UTF-8 encoding but my VS.NET is using gb2312 encoding. I know I can get and change each file from menu [file->advance save option] Can't I set VS.NET 2005 always create and save C# files in UTF-8 encoding?

Upvotes: 2

Views: 2309

Answers (2)

Eduardo Molteni
Eduardo Molteni

Reputation: 39413

VS defaults to UTF-8 when the file is created inside VS. If the file was create (or modified) outside with other encoding, it will honor the existing encoding unless you "save as" -> UTF-8

Upvotes: 1

Joel Coehoorn
Joel Coehoorn

Reputation: 415600

Odd: My VS2005 at work and my copies of vs2008 and vs2005 at home all default to Utf-8.

Upvotes: 0

Related Questions