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