Utf-8 Web page does not display +utf-8 Web page garbled general solution _ Application Tips

Source: Internet
Author: User
When using IE as a browser on the Windows operating system. The problem often occurs when browsing a Web page that uses UTF-8 encoding, which is not automatically detected by the browser (that is, when the Automatically select encoding format is not set) the encoding used for the page.
Even if the page has been declared in the encoding format:

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

This causes some pages containing Chinese UTF-8 encoding to produce blank output.

If you are using Mozilla, Mozilla browsers, and Sarafi browsers, this will not cause this problem. This is because IE parsing the page encoding in HTML is preferred, then the HTTP header message, and the Mozilla series browser is just the opposite.

Since UTF-8 represents a Chinese character for 3 bytes, the average GB2312 or BIG5 is two. Page output, because of the above reasons, so that the browser parsing, output <title></title> content, if in the </title> before the odd number of full-width characters, ie UTF-8 as two byte parsing when half of Chinese characters, At this time the half of the Chinese characters will be combined with </title> < into a garbled word, resulting in IE can not read the <title> section, so that the entire page for the empty hundred output. And this time, if you look at the source file, you will find that the whole leaf has actually been exported.

So the easiest way to do this is to define the character in the
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

Put it in front of <title></title>.

-------------------------------------

=====================

UTF-8 Web page garbled Problem Resolution:
<% @codepage = "65001"%>
< http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
One is not less.
In addition, the file is to be stored in UTF-8 format
Also, the program can not be wrong, hehe
If there is a wrong program, then just open the normal, refreshing the garbled
This error will not cause the entire page to appear without errors.
1,<% @codepage = "65001"%>
2,< http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
3,session.codepage = 65001
4, file deposit into UTF-8
Let me say, this I have more experience, hehe


2,< http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
=======================================
This one is more important and more common, which determines which inner code the browser chooses to access your Web page.

4, file deposit into UTF-8
If you use the Chinese input method, the page appears in Chinese, this one is more important. Because the text we entered in the normal input method is not in UTF format, we want to save it to the UTF-8 format again.

All the text read from the database is garbled
=====================
1,<% @codepage = "65001"%>
This kind of thing, please add this sentence, in fact, the database has nothing to do with the code, the key is the ASP program with what internal code to transmit your data, plus this sentence, forcing the ASP to use UTF to transmit data.
Try adding a line under <% @codepage = "65001"%>:
<%Session.CodePage=65001%>

Utf-8 Web page does not show the +utf-8 page garbled problem can generally be solved

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.