Is codepage 65001 and utf-8 the same thing?

后端 未结 4 1067
我在风中等你
我在风中等你 2020-12-04 19:30
<%@LANGUAGE=\"VBSCRIPT\" CODEPAGE=\"65001\"%>



        
4条回答
  •  有刺的猬
    2020-12-04 19:49

    Your code is correct although I prefer to set the CharSet in code rather than use the meta tag:-

    <% Response.CharSet = "UTF-8" %>
    

    The codepage 65001 does refer to the UTF-8 character set. You would need be make sure that your asp page (and any includes) are saved as UTF-8 if they contain any characters outside of the standard ASCII character set.

    By specifying the CODEPAGE attribute in the <%@ block you are indicating that anything written using Response.Write should be encoded to the Codepage specified, in this case 65001 (utf-8). Its worth bearing in mind that this does not affect any static content which is sent verbatim byte for byte to the response. Hence the reason why the file needs be actually saved using the codepage that is specified.

    The CharSet property of the response sets the CharSet value of the Content-Type header. This has no impact on how the content my be encoded it merely tells the client what encoding is being received. Again it is important that his value match the actual encoding sent.

提交回复
热议问题