Solutions for garbled web pages

Source: Internet
Author: User
Tags blank page

The appearance of webpage garbled characters is generally caused by the storage of webpages, the specified language format, and the inconsistent interpretations of service providers. Once uploaded, the website was garbled and analyzed for some reason. It was found that the encoding explained by Internet Explorer was inconsistent with the encoding of the webpage.

The solution is to use NotePad to open the webpage and set <meta http-equiv = "Content-Type" content = "text/html; change charset = gb2312 "/> to <meta http-equiv =" Content-Type "content =" text/html; charset = UTF-8 ">, and save the file, note that it is important to select UTF-8 as the encoding type! In this way, the garbled characters have disappeared after being saved and uploaded to the webpage. In fact, please note that the storage is in two different formats: UTF-8 and ANSI, which occupy different disk space. Although we open the file in notepad, we can see the same content, but the size of the files occupied by the disk is different! This also affects garbled characters! This is easily overlooked.

In addition, you must note that sometimes, after uploading a webpage, It is a blank page. Why? In Dreamweaver, there is clearly a content, but why is there a blank page and NO content after uploading? Now, move <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"> to

The following code converts gb2312 to UTF-8 encoding:
Step 1:
Modify the commond. asp file to define the cookie in the first four lines of the file. Replace the code before the application domain with the following code:
<% @ Language = "VBScript" codePage = "65001" %>

Option explicit
Response. Buffer = true
Session. codePage = 65001
Server. scripttimeout = 90
Modify the header. asp and admincp. asp files and attachment. asp files to find the program code:
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
Change to program code:
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
Step 2:
Use NotePad to open all ASP and JS files of the blog and save them as the default encoding. You can select UTF-8 as the default encoding.

In fact, the character set displayed on the page is not directly related to the character set used by the file. It is only a declaration. The real entity is the encoding format when the file is saved:ANSI/UTF-8

The most convenient method is as follows:
Do not convert the UTF-8 encoding of the webpage of any module, or gb22312 or gb2312.
<% @ Language = "VBScript" codePage = "65001" %>
<% Session. codePage = 65001%>
<% @ Language = "VBScript" codePage = "936" %>
<% Session. codePage = 936%>
Other codes and so on:

<% @ CodePage = 65001%> UTF-8
<% @ CodePage = 936%> Simplified Chinese
<% @ CodePage = 950%> traditional Chinese
<% @ CodePage = 437%> American/Canadian English
<% @ CodePage = 932%> Japanese
<% @ CodePage = 949%> Korean
<% @ CodePage = 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: 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.