More compliant way to escape JSON strings