Is codepage 65001 and utf-8 the same?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!--#include file="conn.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

Is this code correct?

+34
codepages asp-classic
Oct. 27 '09 at 8:35
source share
4 answers

Yes.

UTF-8 is the CP65001 on Windows (it's just a way to specify UTF-8 in legacy code). As far as I read ASP, you can handle UTF-8 when specified this way.

+39
Oct 27 '09 at 8:40
source share

Your code is correct, although I prefer to install CharSet in the code instead of using the meta tag: -

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

Codepage 65001 refers to the UTF-8 character set. You will need to make sure your asp page (and all inclusive) is saved as UTF-8 if they contain any characters outside the standard ASCII character set.

By specifying the CODEPAGE attribute in the <% @ block, you indicate that everything written using Response.Write must be encoded into the specified Codepage, in this case 65001 (utf-8). It should be borne in mind that this does not affect any static content that is sent verbatim for the byte for the response. Therefore, the reason the file is actually saved is using the specified code page.

The CharSet property of the response sets the CharSet value of the Content-Type header. This does not affect how to encode the content that it encodes, it simply tells the client which encoding will be received. Again, it is important that its value matches the actual encoding sent.

+9
Oct 27 '09 at 9:01
source share

Yes, 65001 is the Windows codepage identifier for UTF-8, as described on the Microsoft website . Wikipedia suggests that the IBM 128 code page and SAP 4110 code page are also indicators for UTF-8.

+3
Oct 27 '09 at 8:59
source share
 response.codepage = 65001 

seems to give a bad result when the physical file is saved as utf-8

Otherwise, it works as intended.

+1
Apr 03 2018-11-18T00:
source share



All Articles