escaping bad json characters in map data