The Request Encoding problem is fixed when the client is in the traditional Chinese system.

Source: Internet
Author: User
The server is a simplified system. However, a problem occurs when the client is a traditional operating system.
In the script, it can be normally written in a simplified system, but when the client is traditional, the value of the obtained action will not work (garbled ). I don't know why?

Window. Open ("test. aspx? Action = testing ");

The value obtained using request. querystring ["action"] on the test. ASPX page is garbled. I did not find the cause after searching for half a day.

Tried the following method, but it still does not work:
1. Set <globalization requestencoding = "gb2312" responseencoding = "gb2312"/>
2. Set page attributes: <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">

[March August 15] finally solved the problem.
Solution: encode server. urlencode ("in test") before opening.
Use server. urldecode (request ["action"]) for request.

However, there is still no way to call server. urldecode in JS, so we found a urldecode written in Js. But the file is a little big. But it still solves the problem.
To reference a script:
Unicode and GB conversion libraries and urlencode and getspell functions, please download
Http://www.blueidea.com/user/qswh/qswhU2GB.js

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.