With the help of thejson_encodefilter you can include characters in the json snippets in your ESL content.
{{contact.1234 | json_encode}}
Result
If the contact field contains characters that would break a json format, thejson_encodefilter solves this problem.