j0k3r / graby

Graby helps you extract article content from web pages
MIT License
362 stars 73 forks source link

function convert2Utf8() return wrong #302

Closed ducwp closed 1 year ago

ducwp commented 1 year ago

I tried with this url: https://www.24h.com.vn/tin-tuc-trong-ngay/dieu-tra-vu-chi-hang-ty-dong-tiep-khach-cua-van-phong-hdnd-tinh-gia-lai-c46a1412042.html.

It get content with character encoding error.

Then I open file j0k3r/graby/Graby.php, add $html = $response['body'] after line 326 (dont use convert2Utf8 ), it's work fine.

dontuseutf

ducwp commented 1 year ago

Or if I add $response['body'] = str_replace('<meta charset = "UTF-8">', '<meta charset="UTF-8">', $response['body']); before line 326, it will work fine.

Screenshot_21