Classic asp character encoding

I have a problem with Spanish characters in a classic asp site. The user can submit their name / address in the form on the aspx page. Then the aspx page makes an ajax message on the classic asp page, everything that it does is stored in our Sql 2008 DB. I see in the database that the character is not saved correctly. For example, the first name looks like Mร‚ยช , where Mยช should be.

When I then read this data and show it in the text box, it still displays Mร‚ยช .

things i tried:

  • <%@ Language=VBScript codepage=65001 %> <% Response.Charset="UTF-8" %>
  • encoding file as UTF-8 (using notepad ++)

any other ideas? Do I need to go back to the database and correct the characters first, or can this be done when I read the characters and show them?

+6
source share
2 answers

What you are looking at is UTF-8. This is probably exactly the way it should be, and the problem is that the tool you use for the search does not correctly handle UTF-8, either because it cannot, or because it is not configured correctly.

+2
source

I had the same problem when you started using utf-8 on ASP, found that session.CodePage matters. Classic ASP pages always have the first first ASP declarations to ensure that all pages use UTF-8 for data, forms, asp code, received or sent data.

 <%@Language=VBScript CodePage = 65001%> <% Session.CodePage = 65001 Response.charset ="utf-8" Session.LCID = 1033 'en-US %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
+10
source

Source: https://habr.com/ru/post/923523/


All Articles