I wonder if it's possible to save all files in a Visual Studio 2008 project into a specific character encoding. I got a solution with mixed encodings and I want to make them all the same (UTF-8 with signature).
I know how to save single files, but how about all files in a project?
If you want to avoid this type of error :
Use this following code :
Encoding number 1252 is the default Windows encoding used by Visual Studio to save your files.
if you are using TFS with VS : http://msdn.microsoft.com/en-us/library/1yft8zkw(v=vs.100).aspx Example :
Since you're already in Visual Studio, why not just simply write the code?
Only three lines of code! I'm sure you can write this in less than a minute :-)
This may be of some help.
Short version: edit one file, select File -> Advanced Save Options. Instead of changing UTF-8 to Ascii, change it to UTF-8. Edit: Make sure you select the option that says no byte-order-marker (BOM)
Set code page & hit ok. It seems to persist just past the current file.
Thanks for your solutions, this code has worked for me :
I have created a function to change encoding files written in asp.net. I searched a lot. And I also used some ideas and codes from this page. Thank you.
And here is the function.
It can placed in .aspx file and then called like: