Mobile Delivery Search Chinese has all become "??????? ¤???? ""??? ·? ±?????? ""????????? ·?? "

Source: Internet
Author: User
Mobile Submission Search Chinese all became "??????? ¤???? ""??? ·? ±?????? ""????????? ·?? "
This post was last edited by default7 on 2012-12-23 13:10:17

very strange phenomenon:
(1) keyword search using mobile phone, Chinese all become "????????? ·", the kind of Latin characters.
(2) using Is_utf8 to detect $_GET[KW] returned is UTF-8 encoded.
(3) Mobile Access file at the very beginning of the direct echo $_GET[KW] Also this look ... Computer access is not

Related configuration:
(1) Database type MyISAM, table character set utf8_general_ci, field kw character Set Utf8_general_ci
(2) PHP versions: PHP version 5.2.17,cgi/fast CGI

(4) Mobile phone related information:





Request_method = GET
(5) Mobile browser uc:8.7.2.214 Android



Example Search for several keywords:
????????? ·
Shenzhen-??? · ±??????
???????, Beijing ¤????



php function Is_utf8 (), from PHP website

function Is_utf8 ($STR) {
$c = 0; $b = 0;
$bits = 0;
$len =strlen ($STR);
for ($i =0; $i < $len; $i + +) {
$c =ord ($str [$i]);
if ($c > 128) {
if (($c >= 254)) return false;
ElseIf ($c >= 252) $bits = 6;
ElseIf ($c >= 248) $bits = 5;
ElseIf ($c >=) $bits = 4;
ElseIf ($c >= 224) $bits = 3;
ElseIf ($c >= 192) $bits = 2;
else return false;
if (($i + $bits) > $len) return false;
while ($bits > 1) {
$i + +;
$b =ord ($str [$i]);
if ($b < | | $b > 191) return false;
$bits--;
}
}
}
return true;
}






------Solution--------------------
First send a language statement to the head and see
  • 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.