Bill Janssen <[EMAIL PROTECTED]> added the comment:

Victor, what kind of content have you tried this with?  For instance, have
you passed unencoded (Content-Transfer-Encoding: binary) binary data through
it, by mailing a JPEG, for instance?  These things are strings really only
at the application level; the data is still bytes.  In addition, the use of
Latin-1 goes against the explicit directives of the IMAP group, doesn't it?
They're pushing UTF-8.

Bill

On Tue, Oct 14, 2008 at 4:27 AM, STINNER Victor <[EMAIL PROTECTED]>wrote:

>
> STINNER Victor <[EMAIL PROTECTED]> added the comment:
>
> Here is a patch for imaplib:
>  - add encoding attribute to IMAP4 class (as ftplib and see also issue
> 3727 for my poplib patch)
>  - use makefile('r', encoding=self.encoding) instead of a binary file
> (mode='rb')
>  - remove duplicate code in IMAP4_SSL
>
> I choosed ISO-8859-1 as the default charset. I tested the library on
> my local IMAP4 server using IMAP4 and IMAP4_SSL classes. But the
> library needs more unit tests as done for poplib.
>
> ----------
> keywords: +patch
> nosy: +haypo
> Added file: http://bugs.python.org/file11786/imaplib_unicode.patch
>
> _______________________________________
> Python tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1210>
> _______________________________________
>

Added file: http://bugs.python.org/file11790/unnamed

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1210>
_______________________________________
<div dir="ltr">Victor, what kind of content have you tried this with?&nbsp; For 
instance, have you passed unencoded (Content-Transfer-Encoding: binary) binary 
data through it, by mailing a JPEG, for instance?&nbsp; These things are 
strings really only at the application level; the data is still bytes.&nbsp; In 
addition, the use of Latin-1 goes against the explicit directives of the IMAP 
group, doesn&#39;t it?&nbsp; They&#39;re pushing UTF-8.<br>
<br>Bill<br><br><div class="gmail_quote">On Tue, Oct 14, 2008 at 4:27 AM, 
STINNER Victor <span dir="ltr">&lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" 
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 
padding-left: 1ex;">
<br>
STINNER Victor &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>&gt; 
added the comment:<br>
<br>
Here is a patch for imaplib:<br>
&nbsp;- add encoding attribute to IMAP4 class (as ftplib and see also issue<br>
3727 for my poplib patch)<br>
&nbsp;- use makefile(&#39;r&#39;, encoding=self.encoding) instead of a binary 
file<br>
(mode=&#39;rb&#39;)<br>
&nbsp;- remove duplicate code in IMAP4_SSL<br>
<br>
I choosed ISO-8859-1 as the default charset. I tested the library on<br>
my local IMAP4 server using IMAP4 and IMAP4_SSL classes. But the<br>
library needs more unit tests as done for poplib.<br>
<br>
----------<br>
keywords: +patch<br>
nosy: +haypo<br>
Added file: <a href="http://bugs.python.org/file11786/imaplib_unicode.patch"; 
target="_blank">http://bugs.python.org/file11786/imaplib_unicode.patch</a><br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________<br>
Python tracker &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue1210"; 
target="_blank">http://bugs.python.org/issue1210</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to