mailgun/flanker — pull request #53 by horkhe (2014-07-25 18:07:53+00:00)
Title: Make EmailAddress.display_name to be an arbitrary string

The problem was that there was no way to create an EmailAddress with a particular human readable display name. Even though EmailAddress constructor had a `display_name` parameter it de-facto had a semantic of an RFC compliant display name **representation**. The difference between human readable form and RFC representation is subtle but substantial, e.g. in representation quotes are just part of the format, whereas in human readable form quotes are a part of the representation. E.g. representations `"Foo Bar"` and `Foo Bar` both correspond to display name `Foo Bar`, at the same time display name `"Foo Bar"` has representation `"\"Foo Bar\""`.

To make sure that whatever is passed in `display_name` parameter is used as human readable display name, a new parameter `parsed_name` was introduced. It is and should be used by parser only, so that values passed in `parsed_name` by the parser are properly unquoted and converted from mime to unicode. `display_name` field always returns a human readable form, and `full_spec()` was modified to make sure that display name is properly encoded and quoted if needed.