PHP Warning: json_encode() [function.json-encode]: Invalid UTF-8 sequence in argument in god_i_hate_this.php

Ever get the following error?

  • PHP Warning: json_encode() [function.json-encode]: Invalid UTF-8 sequence in argument in…

Then you are in the same boat I was in, and unfortunately for me, the solution wasn’t as straightforward as I thought it was. The problem we are seeing is that the value being encoded to json is not UTF-8 encoded data. PHP function json_encode, unfortunately, will only accept UTF-8 as its parameter. Continue reading “PHP Warning: json_encode() [function.json-encode]: Invalid UTF-8 sequence in argument in god_i_hate_this.php”