Rename helper function

It's not really escaping characters; it's swapping them for less
troublesome ones.