After upgrading to Twitter’s new 1.1 API. My program stopped working and threw http 400 error with description “One or more parameters contains an invalid UTF-8 sequence”.
I discovered that it was because I was using
substrfunction in php to cut Chinese characters with UTF8 encoding.
when using substr(), it will create some messy code on languages other than English. In situations like this, it’s better to use mb_substr() or mb_strcut.
From the above example, it's clear to see that mb_substr cuts sentense by actual characters，mb_strcut cuts string by byte