I have a site that displays multiple languages. The site is Classic ASP (VBScript) driven and depending on the users settings (language preferences) will display the HTML in the desired language. The language file is a simple ASP file using a set of if statements to equate a variable to the desired language.
For example:
if language = "Spanish" then
day_name = "lunes"
elseif language = "Chinese" then
day_name = "星期一"
else
day_name = "Monday"
end if
Then the ASP page would include the result:
Today is <%=day_name%>
After many hours of research I have added the following to the header of the ASP pages:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit%>
<%
Response.CodePage = 65001
Response.CharSet = "utf-8"
%>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
%>
The above works fine for English and Chinese, however with Spanish and other languages strange characters appear like "�"
I have also attempted to save the ASP language file as UTF-8, UTF-8-BOM and ANSI (using Notepad++). The characters themselves also change in Notepad++ depending on what option I choose, never all having the correct encoding. Not sure if the solution is to create multiple files, one for each language and each file encoded accordingly (which is technically possible but a significant amount of work to do and maintain).
I can't seem to find the correct balance to suit all languages and any guidance would be appreciated.
Thank you.