From 923512f327af6944bbdbc905d2372658a3977489 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Fri, 12 Jul 2013 16:00:28 -0400 Subject: #18431: Decode encoded words in atoms in new email parser. There is more to be done here in terms of accepting RFC invalid input that some mailers accept, but this covers the valid RFC places where encoded words can occur in structured headers. --- Lib/test/test_email/test_headerregistry.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Lib/test/test_email/test_headerregistry.py') diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py index 80f1c0238e4..f754a324316 100644 --- a/Lib/test/test_email/test_headerregistry.py +++ b/Lib/test/test_email/test_headerregistry.py @@ -158,6 +158,10 @@ class TestUnstructuredHeader(TestHeaderBase): '=?utf-8?q?=C3=89ric?=', 'Éric'), + 'rfc2047_quopri_with_regular_text': ( + 'The =?utf-8?q?=C3=89ric=2C?= Himself', + 'The Éric, Himself'), + } @@ -1119,6 +1123,26 @@ class TestAddressHeader(TestHeaderBase): 'example.com', None), + 'rfc2047_atom_is_decoded': + ('=?utf-8?q?=C3=89ric?= ', + [], + 'Éric ', + 'Éric', + 'foo@example.com', + 'foo', + 'example.com', + None), + + 'rfc2047_atom_in_phrase_is_decoded': + ('The =?utf-8?q?=C3=89ric=2C?= Himself ', + [], + '"The Éric, Himself" ', + 'The Éric, Himself', + 'foo@example.com', + 'foo', + 'example.com', + None), + } # XXX: Need many more examples, and in particular some with names in -- cgit v1.2.3