Solve ASP garbled Problem

Source: Internet
Author: User

I used to encounter garbled characters in ASP before. I only remember that I set the encoding method and how I did it. Now I have an episode about dealing with ASP, I accidentally encountered a garbled problem. I will summarize the problem this time and hope that ASP will not be used in the future.

    1. <Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"> If the page contains Chinese characters, this sentence cannot be saved, put it in
    2. <% @ Language = "VBScript" codePage = "936" %> if all the data obtained from the database is garbled, add this sentence. 936 indicates gb2312 encoding, put it in the first line of each page, remember that each page is not every ASP file.
    3. If garbled characters are still displayed after the preceding settings, or a page execution error occurs (for example, if a string does not end with a mark, it means that the double quotation marks are ended: ", the string is Chinese, but the file is opened with double quotation marks, in addition, adding a space before the last double quotation mark of the string can be executed successfully, but there are still garbled characters), indicating the encoding of some files (both file storage encoding, many editors use UTF-8 by default) Incorrect. Open the error page and Its referenced files to see its page encoding. Here we take the Dreamweaver CS3 editor as an example, in the "modify" menu "Page attribute", click "title/encoding" to check whether the encoding item is "UTF-8". If yes, change it to "gb2312" and save it, check all possible files.

      I have encountered many garbled issues this time. Only the above three problems can 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.