I made a patch implementing the following changes to the IMAP4 class:
- add a method 'enable_UTF8_accept()' sending "ENABLE UTF8=ACCEPT" to the server and setting internal encoding to UTF-8
- use the UTF8 extencion in the 'append()' method if the internal encoding is UTF-8
- add a keyword argument 'enable_UTF8=False' to the init method to trigger 'enable_UTF8_accept()' as soon as the authentication is done
- always use UTF-8 for encoding credentials in authentication (before encoding it to base64)
Does this look like a good idea to you? (I'll make a patch including docs when we agree on the API.) |