mikel/mail — pull request #306 by jamis (2011-11-29 21:17:25+00:00)
Title: Encoding non-latin names in addresses fails when quoted name ends in non-latin character

This patch fixes a problem where code like the following:

mail.to = '"Johann Baarß" '

Would result in a syntactically incorrect "To" header. The problem is that the regex that matches the non-latin characters in Encodings.encode_non_usascii would not match non-latin characters immediately before the closing quote. This patch corrects the regex so that these characters are matched correctly.

There were two tests failing in master before I made this change. The same two tests are still failing after the patch; all others are green, including the test I added.