Only escape characters when required