简体   繁体   中英

How can I make TFS2010/VS2010 save one solution file with a given encoding?

I have a batch file that executes during my build. Every time I check it in with changes, the file gets saved as UTF-8 (or UTF-16, hell I don't know), and thus gets a BOM. That makes it so that whenever the batch file is run, execution will fail because batch files have to be encoded as plain ASCII.

While it is simple to change the encoding on the file when I save it, I forget a lot of times.

Is there a way that I can get TFS or Visual Studio to ALWAYS save that one file in the proper format? (I know I can set VS up to always save all files as a certain type, but I was hoping I could make the change for just one file)

From within Source Control Explorer right-click the file you 're interested in & select 'Properties'.

On the 'General' tab there's the option to "Set Encoding". Check it out to see if you can find a suitable encoding to your purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM