function getfirstchar($str){
if(empty($str)){
return '';
}
$fchar=ord($str{0});
if($fchar>=ord('a')&&$fchar return strtoupper($str{0});
}
$s1 = iconv('utf-8', 'gb18030',$str);
$s2 = iconv('gb18030','utf-8',$s1);
$s=$s2==$str?$s1:$str;
$asc=ord($s{0})*256+ord($s{1})-65536;
if($asc>=-20319&&$asc if($asc>=-20283&&$asc if($asc>=-19775&&$asc if($asc>=-19218&&$asc if($asc>=-18710&&$asc if($asc>=-18526&&$asc if($asc>=-18239&&$asc if($asc>=-17922&&$asc if($asc>=-17417&&$asc if($asc>=-16474&&$asc if($asc>=-16212&&$asc if($asc>=-15640&&$asc if($asc>=-15165&&$asc if($asc>=-14922&&$asc if($asc>=-14914&&$asc if($asc>=-14630&&$asc if($asc>=-14149&&$asc if($asc>=-14090&&$asc if($asc>=-13318&&$asc if($asc>=-12838&&$asc if($asc>=-12556&&$asc if($asc>=-11847&&$asc if($asc>=-11055&&$asc return null;
}
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
回复讨论(解决方案) 简单点就
$s1 = @iconv('utf-8', 'gb18030',$str);$s2 = @iconv('gb18030','utf-8',$s1);
规矩点就
$s = mb_check_encoding($str, 'utf-8') ? iconv('utf-8', 'gbk', $str) : $str;
gb18030 标准虽然发布,但尚未在任何系统中实现