views:

22

answers:

1

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?

+1  A: 

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

http://stackoverflow.com/questions/45426/sql-file-encoding-in-visual-studio

Matt Connolly