Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Convert Windows-1251 to UTF 8

I have a small html code and I need to convert it to UTF-8.
I use this iconv("windows-1251", "utf-8", $html);

All text converts correctly, but if text for example in tag <i>...</i>, then it don't convert text and I see somethig like this Показать мн

like image 576
user2058653 Avatar asked Mar 29 '13 15:03

user2058653


1 Answers

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");
like image 93
Jeff Cashion PhD Avatar answered Sep 21 '22 11:09

Jeff Cashion PhD