A solution to the jquery garbled process illustrated tutorial _jquery

Source: Internet
Author: User

Simple request, simple response, but garbled generated

Why?

Garbled reason is very simple, but it is the code table with the wrong, such as the transmission is BIG5 characters, receive the use of Utf-8, or utf-8 encoding, but with GB2312 decoding.

OK, let's make sure that the garbled in the request process

Then I send the past is garbled?

Open the Test.txt under the c:/tmp/

What is this code, guess?

It seems that the client is right, and correctly to the server side, it should be asp.net got the wrong code, HttpRequest class to find there is no relevant encoding related properties

Look at web.config.

Test it, change it into utf-8, look at it.

The reason is successfully found, it seems that the client-side utf-8, and then the server Big5 receive problems

But this project can not solve this problem, because this old project ran for a long time, change here may affect the previous other programs, then change the client, set request properties for Utf-8, let asp.net not confused

Modify AJAX request code, set CharSet property

Problem to solve, but recently also in vs2005 use jquery, no garbled, may be vs2005 has been default for Utf-8 (have time to find out where is the default, or the TX tell)

vs.net2003 default is the code of the native operating system, such as big5,gb2312, so the garbled problem often occurs.

Also, share a simple text file with the garbled view method.

For some not at the end of txt text file (such as Aspx,cs), you can change the suffix to txt, and then open IE to see, otherwise IE will not recognize, direct download

Too many pictures, please slow the speed of TX Forgive ~ ~

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.