PHP charset问题(不同)

时间:2014-04-19 06:22:57

标签: php string character-encoding mbstring

我有一个与charset问题有关的问题,但它有所不同,因为我没有任何土耳其字符问题。但是,如果我想要它是上层,那将是一个问题。

我的代码低于

//To Up title (Ş,I doesn't be upper)
$haberbaslik = strtoupper($haberbaslik);

//Explode title with space
$haberbaslik =  explode(" ",$haberbaslik);

for($i=0;$i<count($haberbaslik);$i++){
    // title which is exploded is in array
$list = str_split($haberbaslik[$i]);

for($j=0;$j<count($list);$j++){

    if($j==0){
        $text .= $list[$j];
        if($list[$j]=="'"){
                //It is problematic one. When it works, if char is Ş or I it give ? 
                $text .= mb_strtoupper($list[$j+1],'UTF-8');

                $text .= $list[$j+1];


            $list[$j+1] = "";
        }
        if($list[$j]=='"'){
                     //It is problematic one. When it works, if char is Ş or I it give ? 
                $text .= mb_strtoupper($list[$j+1],'UTF-8');

                $list[$j+1] = "";
        }
    }else{
        $text .= strtolower($list[$j]);
    }

}
$text .= " ";
}

错误低于

预计:“Şike” 显示:“? ike”

预计:“伊斯坦布尔” 显示:“伊斯坦布尔”

0 个答案:

没有答案