Problem with ImapLib and subject in French

Valentin Mercier merciervspam at
Mon Jun 18 13:31:12 CEST 2012


I'm trying to search some mails with SUBJECT criteria, but the problem is
the encoding, I'm trying to search french terms (impalib and python V2.7)

I've tried few things, but I think the encoding is the problem, in my mail
header I have something like this:


I need to search unseen mail with the FROM and the SUBJECT criteria. I take
those two in parameters in my python script and the second contain special
caracters like é or è, so I encode the string like this:

             temp = header_encode(unicode('Les grèves','utf-8'),

And the string is exactly the same as the header:


But the search function doesn't find my email, and I don't know why, even
if I try with the entire string of the subject.

I hope you can understand my question and my english (I'm from switzerland
so my english is not so good) and you can answer me.

Thanks in advance and best regards

Valentin Mercier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list