使用 simplexml_load_file() 解析 RSS 資料源,幾天後報錯:
Warning: simplexml_load_file() [function.simplexml-load-file]: input conversion failed due to input error, bytes 0xAD 0xB5 0x3C 0x2F
可能是 RSS 來源混雜其他編碼字元,導致 simplexml 解析錯誤。若 RSS 宣告 encoding="GB2312",內容必須為 GB2312 編碼。
iconv 轉換編碼