pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
696 stars 164 forks source link

db/utils: encode 8bit emails as utf-8 #1524

Closed meskio closed 4 years ago

meskio commented 4 years ago

The encoding as 'raw-unicode-escape' was producing unreadable characters for non-ascii letters.

Closes #1314

meskio commented 4 years ago

I have being heavily using it for the last week reading emails in different languages and encodings and reading a lot of encrypted and signed emails and I think this fixes the issue without problems.

pazz commented 4 years ago

Any chance you could add unit tests from the demo messages posted in #1314? It seems that this issue was introduced by a changed behaviour of the email lib and having tests to cover this would be helpful if that happens again..

meskio commented 4 years ago

I'll give it a try.

meskio commented 4 years ago

After some testing around I found out the problem comes from passing the encoded part over to the mailcap. I modify the existing test_simple_utf8_file to use cat in mailcap and this fails in master but not here.

The other changes are just cosmetic to avoid having a warning in the test for not closing the file.

Does it sound good? Should I rebase the two commits in one?

pazz commented 4 years ago

Could you rebase? The conflict looks like this has made it into master somehow?

meskio commented 4 years ago

It looks like someone has already commited the same fix: https://github.com/pazz/alot/commit/37395809db473fb9a4157084a5b1ea3165914556

I'm happy the problem is fixed.