gb2312 and UTF

Source: Internet
Author: User
Today, when the site, customers want a blog, so the use of this blog to use the program Pjblog.

Today, when the site, customers want a blog, so the use of this blog to use the program Pjblog. Often do the site people know, in the same site using different encodings of the page will produce garbled, more common is gb2312 and Utf-8, for example, I just do the site used by the main station GB2312, blog with the Utf-8, so when the visit will appear garbled, Previously to the department store site to add a questionnaire system, it encountered this problem, at that time to deal with a long time to finish. I did not expect to meet this again today, very relieved, so write a log record this method. In fact, solving this problem is also very simple. Just add the following code to the top of the page.

GB2312 's page Plus
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<%Session.CodePage=936%>

Utf-8 's page Plus
<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<%Session.CodePage=65001%>

Generally we do ASP website, will use conn.asp to connect to the database, this file is generally included in the top of each page, so we just add this code to the top of the conn.asp, the whole station will be solved, of course, if the conn.asp on top of the other files, or conn.asp not put on the top, change the relative trouble Point

936 and 65001 represent gb2312 and Utf-8, some of which we don't use, like
950 Traditional Chinese
437 USA/Canada English
932 Japanese
949 Han Wen
866 Russian



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.