[PHP] mb_convert_encoding: Some API Returned the Wrong Encoding? Convert It!

↑↑This is viewed in Chrome with Big5 encoding. The top is before conversion, and the bottom is after conversion. Yesterday, while playing with the Google Weather API, I found that it has a parameter for setting your language. If you don’t set it, the API returns English in UTF-8 encoding. But if you set zh-TW, it returns Chinese, encoded in Big5. So when using this API, I had to re-encode its return value to UTF-8 before I could use it. After all, there aren’t many Big5 websites left, so yesterday I went looking for the mb_convert_encoding function to do the encoding conversion for me~ ...

February 4, 2011 · 2 min