I encountered a really strange error yesterday when I refactored the start page of a old ASP classic web application.
But before I explain the problem I must explain how the website is built.
The web itself is made of ASP pages saved as ANSI windows 1252. The output sent to the browser I guess is encoded as codepage 1252, because no encoding is declared neither in the response header nor in the HTML HEAD tag.
The Problem:
When I refactored the login page (due to security issues) I did the following:
- converted the ASP-file to utf-8
- Added
<%@ Language="VBScript" @CODEPAGE=65001 %>to the top of the page - Added
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />to theHTML HEAD
The login page displayed nicely. But! The rest of the website now got encoding issues (when displayed on a web browser) on all pages (except the login page of course).
How can that be? I didnt change any other pages, and the encoding settings made in the login page should only affect that single page.
Please enlighten me. Please! 🙂
Because the codepage is stored in the session and it is changing on the login page. If you clear cookies or open an incognito browser, the problem should go away until you return to the login page again.