So the Page runs in ISO-8859-1. Everything works fine and as the page is in German, I can use the German "Umlaut" like äöü ÖÄÜ. So the scripts like asdf.asp are containing öäü - sometimes because of forgotten HTML Encoding in hardcoded Text, but sometimes
also because there is not other way, for example in variables with email text or Record Set contet:
Then suddenly the Page gets Problem with the äöü everywhere. They are replaced by ? or just removed - not only at the HTML Ouput, also for example when sending emails in plain Text. But on the ohter side if I render Text unencoded form the
database like:
response.write(rs("content") and the field "content" has äöü then they are rendered correctly.
So this is not a problem of the output, it seems that the asdf.asp script is convertet in some way because of the meta tag. This actually makes no sense to me, because the meta tag is no server command and the server should just write it to
the buffer like any other string, but it doesn't.
Does anyone have an idea? The problem appers in IIS 7.5 in Windows 7 as well as on IIS 6.0 in W 2003 Server.
Your source files (.asp or any other related) should also be saved in UTF 8 format at least. There are many things to be considered as migrating to UTF 8 is a huge thing, http://stackoverflow.com/questions/1597626/change-website-character-encoding-from-iso-8859-1-to-utf-8
Lex Li
http://lextm.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
All script Files, also the includes need to be saved as unicode, then the problem disappears.
It is still strange why the ASP changed part of the script just because a meta tag was added to the html. I tought the classic asp doesn't care about the output html.
ASP changed nothing (I mean the bytes sent from IIS/ASP to the web browser remain the same, except the meta tag change). However, due to the new meta tag, the web browser tries to interpret the received bytes in UTF-8, while in fact they are still for the old
encoding. That of course leads to the ?-s. Once you converted all script files, then the new bytes can be interpreted in unicode without problems. Well, if you can dive into byte level, then all such behaviors can be easily understood.
Lex Li
http://lextm.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Marked as answer by Lloydz on May 14, 2012 08:14 AM
Yes, I thought the same... but how about the email.
If I send an email, the HTML Meta Tag is not added, it does not play any role. But even in the emails the öäü were missing. And they were not in the source code of the email. The email text is stored in normal asp variables, it is processed by asp and send
by the asp module cdosys and has nothing to do with the browser or the response buffer. But it was affected, too. This let me guess that asp changed the whole content of the script file. I can not find any other reason.
Not sure if that helps at all: the suspicion that IIS did not care of the codepage in an ASP page is rumor. I have been telling others as well as myself for ages to stay in or the other world, but mixing causes trouble. And from my experience this has not
changed from Server 2003 (guess IIS 5 or 6) to Server 2008R2 (IIS 7.5). Believe that was even the case wwith IIS 4 from NT Option pack on NT4.
Jan 12345
5 Posts
UTF-8 Problem
May 10, 2012 08:21 AM|LINK
Hello,
I have a Web Application in Classic ASP which currently is generating this into the response output
meta_global = "<meta http-equiv=""content-type"" content=""text/html; charset=ISO-8859-1"">"
...
Response.write(meta_global)
So the Page runs in ISO-8859-1. Everything works fine and as the page is in German, I can use the German "Umlaut" like äöü ÖÄÜ. So the scripts like asdf.asp are containing öäü - sometimes because of forgotten HTML Encoding in hardcoded Text, but sometimes also because there is not other way, for example in variables with email text or Record Set contet:
MyEmailText = "... bla bla öäü"
or
Rs("MyField") = " ... ö bla bla"
rs.update
When I change now the meta Tag to UTF-8:
meta_global = "<meta http-equiv=""content-type"" content=""text/html; charset=UTF-8"">"
Then suddenly the Page gets Problem with the äöü everywhere. They are replaced by ? or just removed - not only at the HTML Ouput, also for example when sending emails in plain Text. But on the ohter side if I render Text unencoded form the database like:
response.write(rs("content") and the field "content" has äöü then they are rendered correctly.
So this is not a problem of the output, it seems that the asdf.asp script is convertet in some way because of the meta tag. This actually makes no sense to me, because the meta tag is no server command and the server should just write it to the buffer like any other string, but it doesn't.
Does anyone have an idea? The problem appers in IIS 7.5 in Windows 7 as well as on IIS 6.0 in W 2003 Server.
lextm
4486 Posts
Re: UTF-8 Problem
May 10, 2012 08:55 AM|LINK
http://lextm.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 12345
5 Posts
Re: UTF-8 Problem
May 10, 2012 11:20 AM|LINK
I think I solved the problem:
All script Files, also the includes need to be saved as unicode, then the problem disappears.
It is still strange why the ASP changed part of the script just because a meta tag was added to the html. I tought the classic asp doesn't care about the output html.
lextm
4486 Posts
Re: UTF-8 Problem
May 10, 2012 11:54 AM|LINK
http://lextm.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 12345
5 Posts
Re: UTF-8 Problem
May 10, 2012 01:21 PM|LINK
Yes, I thought the same... but how about the email.
If I send an email, the HTML Meta Tag is not added, it does not play any role. But even in the emails the öäü were missing. And they were not in the source code of the email. The email text is stored in normal asp variables, it is processed by asp and send by the asp module cdosys and has nothing to do with the browser or the response buffer. But it was affected, too. This let me guess that asp changed the whole content of the script file. I can not find any other reason.
hubertd
17 Posts
Re: UTF-8 Problem
Jul 04, 2012 11:00 PM|LINK