Avoid parsing abort when encountering invalid unicode data