properly mask escape sequences in quoted strings