Fix bug encoding non-unicode strings

This lets it just save the ascii strings, which seems to work.