Encoding ASP Classic

1

I have an application in .asp and I was having problems with special characters, they were printed on screen in a totally unconfigured way.

To solve the problem, I applied:

Response.CharSet = "ISO-8859-1"
Response.CodePage = 28591

But now they are being printed on screen as .

Note: In my application, there is a mix of .asp and. aspx

    
asked by anonymous 14.08.2015 / 22:03

2 answers

2

Always encode in UTF-8 in ANSI.

ASP Classic Code:

Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8

If you want the HTML code it would be:

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

Why in UTF-8? Because it is much more natural to write the word " ação " than " a&ccedil;&atilde;o " In addition to being the recommended way for language with accents.

Sometimes it is not enough to put the above code if the encoding of the file header is ANSI, so do

Opens the .asp file in Notepad. Send "save as ..." option to utf-8

    
19.08.2015 / 14:57
1

When I move into ASP pages I check two things: the script formatting (page .asp - if it is with ANSI, UTF ...) and script encoding (response.charset). Use for both UTF-8 configurations.

    
19.08.2015 / 14:51