do a better job at escaping TXT, fixes #795