Solution to Asp.net page garbled

Source: Internet
Author: User

The first solution to Asp.net page garbled:

<Globalization
Requestencoding = "gb2312"
Responseencoding = "gb2312"
/>

Asp.net page garbled second solution:

<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">

Third solution to Asp.net page garbled:

Specify the file name when downloading the file, The Chinese file name is garbled ?

Response. addheader ("content-disposition", "attachment; filename =" + httputility. urlencoding (filename. tostring ()));

Solution 4 for garbled Asp.net pages:

Why are the Chinese characters read from the file garbled? 

System. Io. streamreader m_fs = system. Io. file. opentext (hfile_selectfile.value );

Change


System. Io. streamreader m_fs = new system. Io. streamreader (hfile_selectfile.value, system. Text. encoding. getencoding ("gb2312 "));

Solution 5 of Asp.net page garbled characters:

Solve the problem of Chinese garbled characters in query strings?

The query content is encoded by server. urlencode.

String url = "http: // localhost/test. aspx? A = "+ server. urlencode (" James ");
Solution
--> Server. urldecode ()

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.