Handle unicode error in json serialize properly.