=?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
=?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
=?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k?=
- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl?=
- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0?=
+ =?utf-8?q?s_Nunstuck_git_und?=
+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode?=
+ =?utf-8?q?r_die_Flipperwaldt?=
=?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=
''')
=?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
=?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
=?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k?=
- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl?=
- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0?=
+ =?utf-8?q?s_Nunstuck_git_und?=
+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode?=
+ =?utf-8?q?r_die_Flipperwaldt?=
=?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=''')
def test_long_header_encode(self):
=?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
=?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
=?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k?=
- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl?=
- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0?=
+ =?utf-8?q?s_Nunstuck_git_und?=
+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode?=
+ =?utf-8?q?r_die_Flipperwaldt?=
=?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=""")
eq(decode_header(enc),
[(g_head, "iso-8859-1"), (cz_head, "iso-8859-2"),
## raises(UnicodeError, h.append, '[P\xf6stal]', 'us-ascii')
## raises(UnicodeError, Header, u'\u83ca\u5730\u6642\u592b', 'iso-8859-1')
+ def test_utf8_shortest(self):
+ eq = self.assertEqual
+ h = Header(u'p\xf6stal', 'utf-8')
+ eq(h.encode(), '=?utf-8?q?p=C3=B6stal?=')
+ h = Header(u'\u83ca\u5730\u6642\u592b', 'utf-8')
+ eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=')
+
\f
# Test RFC 2231 header parameters (en/de)coding