@@ -2915,6 +2915,45 @@ def test_ews_combined_before_wrap(self):
2915
2915
"mich. And that's\n "
2916
2916
" all I'm sayin.\n " )
2917
2917
2918
+ def test_unicode_after_unknown_not_combined (self ):
2919
+ self ._test (parser .get_unstructured ("=?unknown-8bit?q?=A4?=\xa4 " ),
2920
+ "=?unknown-8bit?q?=A4?==?utf-8?q?=C2=A4?=\n " )
2921
+ prefix = "0123456789 " * 5
2922
+ self ._test (parser .get_unstructured (prefix + "=?unknown-8bit?q?=A4?=\xa4 " ),
2923
+ prefix + "=?unknown-8bit?q?=A4?=\n =?utf-8?q?=C2=A4?=\n " )
2924
+
2925
+ def test_ascii_after_unknown_not_combined (self ):
2926
+ self ._test (parser .get_unstructured ("=?unknown-8bit?q?=A4?=abc" ),
2927
+ "=?unknown-8bit?q?=A4?=abc\n " )
2928
+ prefix = "0123456789 " * 5
2929
+ self ._test (parser .get_unstructured (prefix + "=?unknown-8bit?q?=A4?=abc" ),
2930
+ prefix + "=?unknown-8bit?q?=A4?=\n =?utf-8?q?abc?=\n " )
2931
+
2932
+ def test_unknown_after_unicode_not_combined (self ):
2933
+ self ._test (parser .get_unstructured ("\xa4 "
2934
+ "=?unknown-8bit?q?=A4?=" ),
2935
+ "=?utf-8?q?=C2=A4?==?unknown-8bit?q?=A4?=\n " )
2936
+ prefix = "0123456789 " * 5
2937
+ self ._test (parser .get_unstructured (prefix + "\xa4 =?unknown-8bit?q?=A4?=" ),
2938
+ prefix + "=?utf-8?q?=C2=A4?=\n =?unknown-8bit?q?=A4?=\n " )
2939
+
2940
+ def test_unknown_after_ascii_not_combined (self ):
2941
+ self ._test (parser .get_unstructured ("abc"
2942
+ "=?unknown-8bit?q?=A4?=" ),
2943
+ "abc=?unknown-8bit?q?=A4?=\n " )
2944
+ prefix = "0123456789 " * 5
2945
+ self ._test (parser .get_unstructured (prefix + "abcd=?unknown-8bit?q?=A4?=" ),
2946
+ prefix + "abcd\n =?unknown-8bit?q?=A4?=\n " )
2947
+
2948
+ def test_unknown_after_unknown (self ):
2949
+ self ._test (parser .get_unstructured ("=?unknown-8bit?q?=C2?="
2950
+ "=?unknown-8bit?q?=A4?=" ),
2951
+ "=?unknown-8bit?q?=C2=A4?=\n " )
2952
+ prefix = "0123456789 " * 5
2953
+ self ._test (parser .get_unstructured (prefix + "=?unknown-8bit?q?=C2?="
2954
+ "=?unknown-8bit?q?=A4?=" ),
2955
+ prefix + "=?unknown-8bit?q?=C2?=\n =?unknown-8bit?q?=A4?=\n " )
2956
+
2918
2957
# XXX Need test of an encoded word so long that it needs to be wrapped
2919
2958
2920
2959
def test_simple_address (self ):
0 commit comments