1

We're working with a Classic ASP project in VS 2012. We imported the files from an old repository to a new project.

The issue is that we need to save the file as UTF-8. Some of them already are encoded in UTF-8, but others are encoded in Windows-1252. So googling a bit, we found out about the "Advanced Save Options" menu. We can change the file to UTF-8, but when we make changes to the file and save it (deleting one char, for example), VS then switches automatically to the previous enconding (Windows-1252, or ISO-8859-1, codepage 28591).

Is there a way to make VS to always save the files in UTF-8? Or are we mistaken from the beginning and should take another approach?

PS: We have already set the option "Save as Unicode when data cannot be saved as codepage" PS2: This happens too in VS 2013 preview

Many thanks in advance

Sergio Rosas
  • 545
  • 12
  • 27
  • Visual Studio should by default save in UTF-8. You old files have a different encoding so Visual Studio keep it for those specific files. According to what you said it is strange that VS save as UTF-8 and the set it back to the old encoding. Is there a way you can share one sample file? – glautrou Aug 26 '13 at 11:45
  • Duplicate of [save-all-files-in-visual-studio-project-as-utf-8](http://stackoverflow.com/questions/279673/save-all-files-in-visual-studio-project-as-utf-8) – bastos.sergio Aug 26 '13 at 12:05
  • I read that answer, but it wasn't useful for us, because whenever we changed the encoding, VS switched back to the previous one after editing the file – Sergio Rosas Aug 26 '13 at 12:10

1 Answers1

3

Ok, I found the solution:

I started to paste code from an old file in UTF-8 to an empty one, which was in Windows-1252 and then I changed to UTF-8.

When I pasted the part of the head, there was a

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

and VS then switched to ISO-8859-1, codepage 28591. It seems that VS 2012 / 2013 recognizes the meta tag and what charset you have chosen, and changes the file's encoding, which I find to be logical, but it could be useful to tell the user why you're switching encodings :)

Sergio Rosas
  • 545
  • 12
  • 27