Monday, April 25, 2011

How do I tell VS 2008 to stop putting byte-order marks in front of my files?

By default, Visual Studio 2008 puts the Unicode byte-order mark in front of any file you save. You can override this on a per-file basis by going to File > Advanced Save Options and picking a different encoding.

How do I tell VS to use a default encoding for all files in a particular project or solution? This is drastically screwing up source control, because we have some users who commit files with VS and others who don't, creating "illusory" commits.

From stackoverflow
  • Hi,

    As far as I know there is no option to globally set the encoding in VS 2008. In the express edition that I have "Advanced saves as" is the only option to change the encoding.

    There is a work around however - you can get visual studio to use a different encoding by setting the computers regional settings to, say, English for example. This would in turn force VS to use 'Western European - Codepade 1252' rather than 'Unicode UTF-8 - Codepage 65001'. Again, this works in the Express edition and I'm pretty sure it will in the full application.

    Hope that helps...

    F.

    sassafrass : Ooh, that would be helpful. I don't see an option that lets me do that, though. Is that under Regions in the control panel somewhere?
    Fraser : On XP you go "Control Panel" - "Regional and Language Options" - Advanced - then change the language to English. You will be prompted to restart the machine

0 comments:

Post a Comment