IMAPDB, decode ISO-8859-1 in sender.from name

31 views
Skip to first unread message

javierobcn

unread,
Aug 31, 2014, 5:55:33 AM8/31/14
to web...@googlegroups.com

Hi

I'm working with IMAPDB adapter, i can connect and read the messages, but i want proccess and store in DB some messages. The problem is with the message.sender field and some characters... the sender can be something similar to: Juan =?ISO-8859-1?Q?Cint=F3?= <in...@example.com>

I need convert or decode the sender name part to Juan Cintó (note the o cute) to store in db without the ?ISO-8859-1Q? 

I need print the value on view... how i can decode the original string Juan =?ISO-8859-1?Q?Cint=F3?= <in...@example.com>  to Juan Cintó <in...@example.com>

how i can do this? any idea are appreciated

Thanks in advance, Web2py is awesome...

Leonel Câmara

unread,
Sep 1, 2014, 2:43:50 PM9/1/14
to
Humm the IMAP adapter does this:

            # decode quoted printable
            self.db[name].to.represent = self.db[name].cc.represent = \
            self.db[name].bcc.represent = self.db[name].sender.represent = \
            self.db[name].subject.represent = self.header_represent

So it seems all you need is to take advantage of the field's represent by rendering the rows.
Reply all
Reply to author
Forward
0 new messages