From bb78217f44bbe9b371b9c08b607c852558a0911b Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 23 Jun 2013 08:47:51 -0500 Subject: [PATCH] fixed Issue 1555:imap: default string field represent ignores encoding, thanks Alan --- VERSION | 2 +- gluon/dal.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c94e6ae9..de9b9614 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.5.1-stable+timestamp.2013.06.23.08.45.09 +Version 2.5.1-stable+timestamp.2013.06.23.08.47.09 diff --git a/gluon/dal.py b/gluon/dal.py index 122807ee..f625e09c 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -6071,6 +6071,8 @@ class IMAPAdapter(NoSQLAdapter): def header_represent(f, r): from email.header import decode_header text, encoding = decode_header(f)[0] + if encoding: + text = text.decode(encoding).encode('utf-8') return text def encode_text(self, text, charset, errors="replace"):