pulb / mailnag

An extensible mail notification daemon
GNU General Public License v2.0
254 stars 32 forks source link

IMAP specific mutf7 encoding and decoding moved #140

Closed tikank closed 8 years ago

tikank commented 8 years ago

I moved IMAP specific folder encoding from account dialog to IMAP backend. So backends return now unicode names in requests_folders method and take unicode names from config. Output in account dialog is still same as before.

However, folder names are now encoded differently in config file, since they are now encoded by json.dumps: folder = ["INBOX", "Ty\u00f6"] I am not sure if this change is a problem. The encoding came from https://github.com/pulb/mailnag/pull/130, and I think there is not yet new release after that. ... or is there? Version number is already updated...

tikank commented 8 years ago

Wait a moment. I'll check few options of dumps and loads...

tikank commented 8 years ago

Yes, there is ensure_ascii option in loads and dumps. Setting it false, output will be UTF-8. I'll try that later.

tikank commented 8 years ago

Oh, I hate unicode handling in Python2... Anyway, now config file can contain something like: folder = ["INBOX", "Työ"]

pulb commented 8 years ago

However, folder names are now encoded differently in config file, since they are now encoded by json.dumps: folder = ["INBOX", "Ty\u00f6"]

What do you mean, "differently"? I'm confused - wasn't it already encoded like this before your changes (introduced in #130 as you correctly pointed out :))?

I am not sure if this change is a problem. The encoding came from #130, and I think there is not yet new release after that. ... or is there? Version number is already updated.

No, there was no new release yet.

tikank commented 8 years ago

Folders were before this change encoded using that mutf7 IMAP encoding, because encoding was only in account dialog for displaying folders correctly. Like this: folder = ["INBOX", "Ty&APY-"]