Recently I used php to write a program (UTF8 encoding) and found that garbled characters may occur when sending an odd number of Chinese characters to the server in http get mode. At first I thought there was a problem with the PHP program or service configuration, later I checked for half a day and found no. I found in google that some people said that IE6 had compatibility problems, and IE7, IE8, FIREFOX, and CHROME didn't have this problem.
The solution to this problem is simple. Simply use urlencode encoding for processing. Note that if javascript is used to pass parameters, the encodeURI function is used. In fact, this should be a habit. urlencode processing is performed on all get parameters, which makes the program more robust, compatible, and portable.
Articles you may be interested in
- Simple Example of php getting webpage content through socket
- Common PHP anti-injection vulnerability filtering function code
- Javascript restricts that only numbers (including decimal places) can be entered in the text box)
- Differences between variables and functions in php after the static keyword is added
- Div css book tutorials recommend "professional CSS + DIV webpage style and layout video tutorials"
- PHP functions for converting Arabic numerals into Chinese Characters
- MySQL replace function replacement string statement usage
- Windows cannot start the hardware device because its configuration information (in the Registry) is incomplete or damaged. (Code 19) Solution