fix mail reading: don't raise invalid byte sequence in UTF-8 when reading non-UTF-8 emails #347

Merged
merged 1 commit into from Nov 9, 2012

Projects

None yet

8 participants

@mreinsch

recreated the pull request I did in #341 to fix #340. This version should also be fine with ruby 1.8.7 - if not, please adjust.

@bogdan

+1 for this.

Other mail clients(not based on ruby mail) like gmail displays such letters without telling that something is wrong. We should do the same.

@shingara

👍 to merge it.

@sickill

+1

@tenderlove

bump?

@davesmylie

+1 to merge please =)

@mikel
Owner

Thanks, looks good. Merged.

@mikel mikel merged commit c7818a9 into mikel:master Nov 9, 2012
@sickill

👍

@jeremy jeremy commented on the diff Jul 23, 2014
lib/mail/message.rb
@@ -1884,6 +1884,7 @@ def parse_message
end
def raw_source=(value)
+ value.force_encoding("binary") if RUBY_VERSION >= "1.9.1"
@jeremy
jeremy Jul 23, 2014

This changes the encoding of its argument unexpectedly. Compare with value = value.dup.force_encoding('binary') or value = value.encode('binary')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment