|
beacon框架functions.inc.php有带一个处理函数
>>>>d:\project.syant\0005php\htdocs\sfc-source\phar\beacon_src\functions.inc.php<<<<<
function strToUtf8($str){
>>>>d:\project.syant\0005php\htdocs\sfc-source\functions.inc.php<<<<<
function strToUtf8($str){
- /*
- * 任意字符串编码转为utf-8
- */
- function strToUtf8($str){
- $encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
- if($encode == 'UTF-8'){
- return $str;
- }else{
- return mb_convert_encoding($str, 'UTF-8', $encode);
- //$source = iconv($encode, "UTF-8//IGNORE", $str);
- }
- }
复制代码
|
|