Sergio Rosas
Sergio Rosas

Reputation: 545

Classic ASP enconding with VS 2012/2013 preview

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

Upvotes: 1

Views: 1311

Answers (1)

Sergio Rosas
Sergio Rosas

Reputation: 545

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 :)

Upvotes: 3

Related Questions