ASP Tutorial: gb2312 utf-8 and solve garbage problem

Articles for reprint: https: //www.xp.cn/b.php/31663.html

Respect of copyright

Do the site today, the client to a blog, so I take advantage of this program pjblog use for the blog. Often do Web site people know, use different coding in the same site where the page will produce garbled, more common is gb2312 and Utf-8, for example, I just made the site master with gb2312, blog with the utf-8 , so that when you visit garbled, former department store site to add a questionnaire system, ran into this problem, when the fiddle for a long time to get it. I did not expect this encounter today, very pleased, then write an article about this logging method. In fact, to solve this problem is simple. Just add the following code at the top of the page on it.

plus gb2312 page
<% @ the LANGUAGE = "VBSCRIPT" the CODEPAGE = "936"%>
<% = 936% the Session.CodePage>

UTF-plus. 8 page
<% @ the LANGUAGE = "VBSCRIPT" the CODEPAGE = "65001"%>
< % Session.CodePage = 65001%>

generally, we do asp website, conn.asp will be used to connect to the database, the files are generally included at the very top of each page, so we just put this code is added to the top of conn.asp the whole station will have been solved, of course, if it contains other files on conn.asp, or conn.asp not on the very top, change up relatively little trouble.

Which is 936 and 65001, respectively, and represented gb2312 utf-8, there are some that we do not commonly used, such as
950 Traditional Chinese
437 US / Canadian English
932 Japanese
949 Korean
866 Russian

 

Today, the customer made a phone station, client PC station is asp, encoding utf-8, our mobile station is asp, coding gb2312;

Phone station is accessible, but the Chinese garbled, look at Baidu. See this article, perfect to solve the problem!

Share out, hope to help more people!

Guess you like

Origin www.cnblogs.com/suni1024/p/12090745.html