Fix encoding issues when exporting a text file

Also removes a redundant comment.

gb#737805