Skip to content

Commit

Permalink
Add ruby-1.8 support to Pull request #562
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Jun 27, 2013
1 parent 01b0aac commit 1d09b6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mail/version_specific/ruby_1_8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def Ruby18.param_encode(str)

def Ruby18.fix_encoding(encoding)
case encoding.upcase
when 'UTF8'
when 'UTF8', 'UTF_8'
'UTF-8'
when 'UTF16', 'UTF-16'
'UTF-16BE'
Expand Down
6 changes: 6 additions & 0 deletions spec/mail/encodings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@
b.should eq "Der Kunde ist König"
end

it "should handle utf_8" do
a = 'Der Kunde ist K=?utf_8?B?w7Y=?=nig'
b = Mail::Encodings.unquote_and_convert_to(a, 'utf-8')
b.should eq "Der Kunde ist König"
end

end
end

Expand Down

0 comments on commit 1d09b6b

Please sign in to comment.