From c4d8f7de2e451f8490c489c44dbd9103cebc38bb Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 29 Jul 2010 11:04:51 +0200 Subject: [PATCH] fix encoding in sent messages (closes #308) --- weboob/backends/aum/pages/contact_thread.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/backends/aum/pages/contact_thread.py b/weboob/backends/aum/pages/contact_thread.py index 80766ee5..d19d1612 100644 --- a/weboob/backends/aum/pages/contact_thread.py +++ b/weboob/backends/aum/pages/contact_thread.py @@ -232,7 +232,10 @@ class ContactThreadPage(PageBase): def post(self, content): if isinstance(content, unicode): - content = content.encode('iso-8859-15', 'replace') + # LOL the data is Windows-1252 encoded, even if the charset label + # of the page is ISO-8859-1. + # That's crappy, but necessary if we want to use special chars. + content = content.encode('Windows-1252', 'replace') if len(content) < 3: raise AdopteCantPostMail("Your message is too short (minimum 3 chars)")