Detect encoding and make everything UTF-8

前端 未结 24 2412
暗喜
暗喜 2020-11-22 03:03

I\'m reading out lots of texts from various RSS feeds and inserting them into my database.

Of course, there are several different character encodings used in the fee

24条回答
  •  一生所求
    2020-11-22 03:19

    I had same issue with phpQuery (ISO-8859-1 instead of UTF-8) and this hack helped me:

    $html = '' . $html;
    

    mb_internal_encoding('UTF-8'), phpQuery::newDocumentHTML($html, 'utf-8'), mbstring.internal_encoding and other manipulations didn't take any effect.

提交回复
热议问题