Solution to overseas space garbled display problems

Source: Internet
Author: User
Tags mdb database

On the data extraction page, replace the first line of code with the following code:

<% @ Language = vbscript codepage = 936%>

1.if the html file (.htm. html)

In

2. If it is a PHP/cgi file (. php. php3. php4)

Add <? Header ("content-Type: text/html; charset = gb2312";?>

3. If it is an asp file (. asp. jsp)

Now let's get down to the point and talk about the solutions to the Chinese problem of asp source files on foreign servers.

1. first, put your asp source file in IIS for a comprehensive test, call each function, make sure it is fully usable, display Chinese correctly, and open *. check whether the Chinese display is normal in the mdb database file. After all the files are backed up, you can perform step 2.

2. If you do not understand asp, open all *. asp files and insert <% @ codepage = "936" %> in the first line,

Exceptions:

① If the first line starts with <% @ LANGUAGE = "VBs succeeded" %>, change the first line: <% @ codepage = "936" LANGUAGE = "VBs success" %>

② If the first line begins with
3. after step 2 is completed, use IIS to test each function, such as conn. asp line 1 is the error message, meaning: conn. asp source file first line error, then delete the <% @ codepage = "936" %>, some exceptions, please go to the http://search.microsoft.com/default.asp; here, enter "error message" to query. After all functions are tested, upload them to a foreign server for testing.

4. method: Call each function. After all the functions are correctly used and Chinese characters are displayed, click "Next "*. mdb File (very important), open it, and make sure that Chinese characters are correctly displayed. In addition, the Chinese display method of ACESS2000 on a foreign server does not need to be converted to the database ACESS2000. You only need to add <% @ codepage = 1256%> In the first line of ASP to solve the problem of Chinese display in a foreign space.
Non-Program-generated text can be displayed. However, only E text generated by the program can be displayed. All Chinese characters? Number, which is caused by database garbled characters.

Method 1:

Use Microsoft Access 2000 to open the database. Choose tools> Database Utilities> convert database> to an earlier Access database version. OK!

Method 2:

Later, I subscribed to Microsoft's newsgroup, which is in Microsoft's newsgroup dotnet. framework. aspplus. general found an article discussing this issue, the method is to add <% @ CODEPAGE = "936" %> to the beginning of each page, it is a bit similar to <% @ page contentType = "text/html; charset = gb2312" %> in jsp. I tested it and it was OK !!!

The example is shown below:

The following is a reference clip:
<% @ CODEPAGE = "936" %>
<% @ Import Namespace = "System. Data" %>
<% @ Import Namespace = "System. Data. ADO" %>
<% @ Import Namespace = "System. Globalization" %>
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>


Method 3:

Add a config. web file to the web directory and create a config. web file. The content is as follows:

The following is a reference clip:
<Configuration>
<Globalization
Requestencoding = "UTF-8"
Responseencoding = "UTF-8"
/>
</Configuration>


PHP space garbled Processing Method

First, decode the code according to the method provided by the program provider you are using. If it cannot work, then:

You can modify the. htaccess file to add the language to the desired encoding.

The following is a reference clip:
Adddefacharcharset off
AddType text/html; charset = gb2312 html

Or

The following is a reference clip:
Adddefacharcharset off
AddType text/html; charset = UTF-8 html


As for modifying. htaccess, you have to set its attribute to 0777 first, and then modify it. If you directly overwrite the local file, the permissions cannot be overwritten. We recommend that you use the boom tool.

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.