add escaped characters in a string