I spent a couple of hours to find this really simple error. I hope this little tutorial helps some else to solve this problem faster.
It had an invalid json file, which I created with my php code:

At the end of the file was a invisible character - a byte order mark (BOM). I converted my file to "UTF without BOM":
I replaced all BOMs:
preg_replace('/^\xef\xbb\xbf/', '', $string);
but nothing helped. Then I changed the view to hex (UltraEdit German: STRG + H, Ultraedit English: CTRL + H):
Solution:
To make a long story short: I just deleted the last character ">" and the BOM was gone:
Really stupid to waste some hours for such a simple solution. Maybe this helps someone else.


