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
The most voted answer doesn't work. Here is mine and hope it helps.
function toUTF8($raw) { try{ return mb_convert_encoding($raw, "UTF-8", "auto"); }catch(\Exception $e){ return mb_convert_encoding($raw, "UTF-8", "GBK"); } }