This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12109|Reply: 1

PHP json_encode Chinese become a question mark

[Copy link]
Posted on 5/28/2017 11:37:11 AM | | | |


I used php to query the database records, and all the Chinese became question marks.

PHP 5.2 or above uses json_encode as a built-in function, which brings great convenience to website builders, but we must note that json_encode only supports UTF8 encoded characters, otherwise, Chinese garbled or null values will appear.

Solution:


mysql_set_charset — Set the character set for the client

Successfully resolved !!!




Previous:.net/C# gets Caps lock case status and modifications
Next:Tomato Garden Ghost Windows7 32-bit & 64-bit Ultimate Edition v201705
Posted on 5/30/2019 4:24:24 AM |
Punch in and grab a sofa, coding problems have always been a common and headache problem for domestic website builders, especially novices.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com