Escape characters rather than remove them. Handle double quotes in OSX.