If you're displaying user input you could just encode to their matching HTML entities...
{ or the human friendlier one &rcurb (?)
{ or the human friendlier one &rcurb (?)
As to why this works this way, consider the following:
do you have to do HTML entity decoding when getting an input value from Javascript?