PHP Convert Windows-1251 to UTF 8
You know, message like Показать мн
you see if
encoding for page is windows-1251
, but text encoded in utf-8
.
I saw this problem in one of my project, so just change change encoding for page in utf-8
and this text will shown correctly.
Let me take you some examples:
if page in utf-8
, but text in windows-1251
you wil see something like this:???? ?? ?????? ??? ????? ??? ??????? ?? ????? ???? ??? ?????
if page in windows-1251
, but text in utf-8
you see this:"Мобильные телефоны";"Apple iPhone 4
If you have access to the Multibye package, you can try it. See the PHP page here: http://www.php.net/manual/en/function.mb-convert-encoding.php
$html_utf8 = mb_convert_encoding($html, "utf-8", "windows-1251");