문제

mb_convert_encoding 또는 기타 방법을 사용하여 PHP에서 러시아 문자를 UTF-8로 변환하는 방법은 무엇입니까?

도움이 되었습니까?

해결책

다음을 시도 했습니까? 그래도 작동하는지 확실하지 않습니다.

mb_convert_encoding($str, 'UTF-8', 'auto');

다른 팁

$file = 'images/да так 1.jpg';//this is in UTF-8, needs to be system encoding (Russian)
$new_filename = mb_convert_encoding($file, "Windows-1251", "utf-8");//turn utf-8 to system encoding Windows-1251 (Russian)

이제 러시아 파일은 PHP에서 러시아 문자를 열어야합니다.

또는 반대가 필요하다면 ...

$new_filename = mb_convert_encoding($file, "utf-8", "Windows-1251");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top