Visual Studio 2010: Is it possible to force editor to use ANSI rather than UTF-8?

0

I am having issues with some files in automated processes, specifically with batch files and sql files. Visual Studio seems to create these as UTF-8 rather than ansi and adds some kind of special characters to the beginning of the file (I think this is a called a pre-amble) This breaks running batch files and running swl files through osql.exe. I have had issues myself in the past in creating text files using C#, but can get around that through encoding. However its seems a bit strange I cant use Visual studio to create batch files and sql files in a database project for automation.

Mark Redman

Posted 2010-04-26T07:08:54.510

Reputation: 213

Answers

0

I think I have answered my own question by finding this answer on Stack Overflow:

https://stackoverflow.com/questions/854360/visual-studio-inserts-invalid-characters-in-batch-files

and more info on the characters here: http://en.wikipedia.org/wiki/Byte-order_mark

Mark Redman

Posted 2010-04-26T07:08:54.510

Reputation: 213

1

You can use Save As and then click the little arrow right next to the Save button. There you select Save with encoding and select UTF-8 without signature (or whatever suits you; for Batch files you probably want Western European (DOS) – 850) in the list.

Joey

Posted 2010-04-26T07:08:54.510

Reputation: 36 381