Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
up vote 0 down vote accepted

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

http://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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .