added handling for querying strings with non standard characters

prior to the fix, querying non standard characters would crash the json serialization