Solutions to garbled ASP

Source: Internet
Author: User

Garbled text is actually not a problem. asp, PHP, and JSP have all of them. I think all the conversion encoding will happen. Generally, the same encoding method is used from start to end without garbled characters. The GBK encoding used by the database, and the GBK encoding is also specified on the page. Similarly, the database uses unicode encoding, and the page uses UTF-8 encoding. If garbled characters appear, the incorrect encoding format must be used.
use ASP as an example. If you find garbled characters appear during page browsing. You can try the following steps:

    1. make sure that the encoding format of your page is correct: for example, if charset = UTF-8 is used in test. asp, make sure that the file itself is Utf-8 encoded. You can use Notepad for conversion. If charset = GBK is used, make sure that the file is GBK encoded.
    2. confirm the encoding method of the original data (such as the data obtained from the database) and the page encoding method.
    3. try to specify the encoding used to read IIS.
      <% @ 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
      codePage specifies the encoding used to read IIS.
      for example, using UTF-8 encoding, add <% @ Language = "VBScript" codePage = "65001" %>
      on the top of the file, for example, using GBK encoding, add <% @ Language = "VBScript" codePage = "936" %>
    4. at the top of the file.
    5. set ASP built-in object symbol ing and response Content-Type Header encoding
      if you use UTF-8 encoding, add
      <% session at the top of Article . code Page = 65001
      response. charset = "UTF-8" %>
      if you use GBK encoding, add:
      <% session. code Page = 936
      response. charset = "GBK" %>
    6. Note: You can put the settings mentioned in 3, 4 at the top of a public-contained file (such as Conn. asp. This attribute is applied to all pages.

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.