문제

My client's web app has large database which millions of records. All table's encoding is latin1.

When I fetch some text field which holds huge data and mail that string some strange haracter issue comes. Such when I recieve email spaces are converted into this character Â. It is not premissible to change the DB encoding. I tried the following PHP function but no outcome ;(

$msg = mb_convert_encoding($msg, "UTF-8", "latin1");

Please help

도움이 되었습니까?

해결책

I would check for the encoding php thinks it is

echo mb_detect_encoding($str);

And then do

iconv("detectedEncoding", "UTF-8", $str);

Or if iconv is not installed, check if your encoding was right in your solution. ;)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top