thoughtbot/griddler — pull request #27 by e3matheus (2013-02-21 18:36:30+00:00)
Title: Dont assume mail body text encoding is binary

The clean_invalid_utf8_bytes method from the email class assumes that the source encoding of the content is binary always. The problem with that is that it replaces characters from other encodings. Lets say my email is written in spanish. So if I write somewhere in the email my name(Elías), the clean invalid utf-8 bytes would chop the í and the result would be Elas.

As far as I can see in the code, the charsets hash is not used. With this patch the charsets hash is used to detect the source of the encoding and defaults to binary if it is not set.

I made another small change. There was a test that wasn't using the body_from_email test. I refactored the test to use the helper.