Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.