This simple code show you the problem:
class MyObject
{
var $publicString = "This is a weird character : é and it will trunk this sentence";
}
$myObject = new MyObject();
var_dump(json_encode($myObject));
The var_dump output is :
string(47) "{"publicString":"This is a weird character : "}"
Why?
json_encode()expects UTF-8 data.I assume your file is ISO-8859-1 encoded. ISO-8859-1
éis an invalid character in UTF-8.A workaround would be storing the file as UTF-8, or doing an
iconv():