Character Encoding issue with PHP Simple HTML DOM Parser

前端 未结 3 1482
被撕碎了的回忆
被撕碎了的回忆 2021-01-07 00:14

I am using PHP Simple HTML DOM Parser http://simplehtmldom.sourceforge.net/ to fetch data like Page Title, Meta Description and Meta Tags from other domains and

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 01:03

    I had the same problem with Romanian characters. Nothing worked until I used

    header('Content-Type: text/html; charset=ISO-8859-2'); 
    

    ISO-8859-2 being the character set for Eastern European letters. So find the right character set for your language and use it in header.

提交回复
热议问题