Add escape functions to escape problematic characters in a string