caiobegotti / Lost-Photos-Found

Linux version of the LostPhotos application for Mac/Windows
125 stars 9 forks source link

Handle headers with multiple encodings #23

Open cmatsuoka opened 8 years ago

cmatsuoka commented 8 years ago

It came to my attention that email.header.decode_header() returns a list of (string, encoding) pairs and our _charset_decoder function was handling only the first pair in this list. This was especially visible when decoding headers such as "=?Windows-1252?Q?Mauricio_Sim=F5es?= bla@bla" where the email address, which was decoded in the second pair, was lost in the final converted string.

Iterate over the list pairs and convert them separately to address this issue.

27/11 update: Additional commits deal with cosmetic changes to address pylint warnings, vim indent helpers to prevent mixing tabs and spaces, and a fix for mixed tabs and spaces.

caiobegotti commented 8 years ago

Shouldn't these new commits be in a separate PR? :-X

cmatsuoka commented 8 years ago

They should, but apparently Github shoves them into the previous one. I guess you'll have to pull selectively from the command line.

caiobegotti commented 8 years ago

Hmm isn't it because you are re-using an old branch for these commits instead of a new one?

cmatsuoka commented 8 years ago

It could be, I'm developing in master.