diadem
diadem

Reputation: 854

Visual Studio 2008 - Default Encoding style with .SQL files

Tools used:
Visual Studio 2008
Team Foundation Server or Visual Source Safe

Backstory:
We add our SQL files to our source control. We do this by adding them to the solution with the .sql extension and checking them in.

By default these files are saved as unicode. What that means is that user A can save foo.sql and user B can get latest and grab foo.sql

Problem:
Unfortunately, since the encoding is unicode by default, if foo.sql happens to have a file size that is divisible by 8 bits the system will open up the file in the wrong format. This causes the file to look like it has chinese characters instead of normal sql statements.

This can be fixed if the user A manually changes the encoding type to western european, but that's a huge pain. It's also very difficult to notice if user A forgot to manually set the encoding unless a problem occurs.

Question:
Is there a way to have visual studio make the default encoding of sql files western european? Is there a way to batch update the encoding type of files in visual studio?

Upvotes: 0

Views: 940

Answers (1)

Matt Connolly
Matt Connolly

Reputation: 1233

You can update the Visual Studio default files. See the answers in this post:

SQL file encoding in Visual Studio

Upvotes: 1

Related Questions