Added exceptions when json_encode fials + config file_encoding for icvon

I ran in a couple of wired issues because our code is (unfortunately) not utf8 encoded. 

Maybe someone else has similar issues.

I wasn't sure whether or not to add file_encoding to the README and it might not be the "correct" name anyway. Please let me know if you want me to change something.