mikel/mail — pull request #352 by avaynshtok (2012-02-12 01:12:38+00:00)
Title: support ascii strings in unstructured fields

Our team ran into an issue where passing valid ascii encoded strings to Mail::SubjectField.new caused encoding exceptions (U+2013 from UTF-8 to US-ASCII (Encoding::UndefinedConversionError)).

The offending code was `result.encode!(value.encoding || "UTF-8")` found here: https://github.com/mikel/mail/blob/master/lib/mail/fields/unstructured_field.rb#L65

I don't know how to prove the correctness of this change, but removing that line:
1. fixed our problem
2. did not cause any tests to break (I tried ruby 1.8 and 1.9)

The new specs are an accurate representation of what we were experiencing and fail w/ the old code.

I'm looking for feedback on whether this is a reasonable change or if there is an alternative way of getting around the problem we experienced.