Docker image dropped and "New state of 'nil' is invalid." error thrown when parsing Arabic

When I try to parse Arabic and return it as JSON I get the error message “New state of ‘nil’ is invalid.” and the image crashes. Anyone have any ideas why? I think it might be en encoding issue but docker seems to deal with Chinese just fine so I’m not confident in my suspicion. Thanks for any help.