Classic ASP text substitution and UTF-8 encoding

后端 未结 3 1595
萌比男神i
萌比男神i 2020-12-09 17:50

We have a website that uses Classic ASP.

Part of our release process substitutes values in a file and we found a bug in it where it will write the file out as UTF-8.

3条回答
  •  时光说笑
    2020-12-09 18:21

    I was searching on the same exact issue yesterday and came across:

    http://blog.inspired.no/utf-8-with-asp-71/

    Important part from that page, in case it goes away...

    ASP CODE:

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

    and the following HTML META tag:

    
    

    We were using the meta tag and asp CharSet property, yet the page still didn't render correctly. After adding the other three lines to the asp file everything just worked.

    Hope this helps!

提交回复
热议问题