Handle potential json encoding problems

Twitter can sometimes throw non UTF-8 characters, which causes rjson to behave oddly. This check ensures that the json string is UTF-8 encoded.