@@ -580,9 +580,9 @@ def test_long_nonstring(self):
580580 =?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
581581 =?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
582582 =?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
583- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k ?=
584- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl ?=
585- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0 ?=
583+ =?utf-8?q?s_Nunstuck_git_und ?=
584+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode ?=
585+ =?utf-8?q?r_die_Flipperwaldt ?=
586586 =?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=
587587
588588''' )
@@ -598,9 +598,9 @@ def test_long_nonstring(self):
598598 =?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
599599 =?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
600600 =?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
601- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k ?=
602- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl ?=
603- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0 ?=
601+ =?utf-8?q?s_Nunstuck_git_und ?=
602+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode ?=
603+ =?utf-8?q?r_die_Flipperwaldt ?=
604604 =?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=''' )
605605
606606 def test_long_header_encode (self ):
@@ -2088,9 +2088,9 @@ def test_multilingual(self):
20882088 =?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM?=
20892089 =?utf-8?b?44CB44GC44Go44Gv44Gn44Gf44KJ44KB44Gn?=
20902090 =?utf-8?b?44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGE=?=
2091- =?utf-8?b?cyBOdW5zdHVjayBnaXQgdW5k ?=
2092- =?utf-8?b?IFNsb3Rlcm1leWVyPyBKYSEgQmVpaGVyaHVuZCBkYXMgT2Rl ?=
2093- =?utf-8?b?ciBkaWUgRmxpcHBlcndhbGR0 ?=
2091+ =?utf-8?q?s_Nunstuck_git_und ?=
2092+ =?utf-8?q?_Slotermeyer=3F_Ja!_Beiherhund_das_Ode ?=
2093+ =?utf-8?q?r_die_Flipperwaldt ?=
20942094 =?utf-8?b?IGdlcnNwdXQu44CN44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=""" )
20952095 eq (decode_header (enc ),
20962096 [(g_head , "iso-8859-1" ), (cz_head , "iso-8859-2" ),
@@ -2165,6 +2165,13 @@ def test_string_charset(self):
21652165## raises(UnicodeError, h.append, '[P\xf6stal]', 'us-ascii')
21662166## raises(UnicodeError, Header, u'\u83ca\u5730\u6642\u592b', 'iso-8859-1')
21672167
2168+ def test_utf8_shortest (self ):
2169+ eq = self .assertEqual
2170+ h = Header (u'p\xf6 stal' , 'utf-8' )
2171+ eq (h .encode (), '=?utf-8?q?p=C3=B6stal?=' )
2172+ h = Header (u'\u83ca \u5730 \u6642 \u592b ' , 'utf-8' )
2173+ eq (h .encode (), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=' )
2174+
21682175
21692176
21702177# Test RFC 2231 header parameters (en/de)coding
0 commit comments