Permalink
Browse files

Alias shift-jis charset to Shift_JIS Ruby encoding

Closes #466
  • Loading branch information...
1 parent 88457e6 commit 02bb6132295b79e175574d372918a6430ea185e3 @jeremy jeremy committed Jan 27, 2013
Showing with 10 additions and 0 deletions.
  1. +1 −0 CHANGELOG.rdoc
  2. +4 −0 lib/mail/version_specific/ruby_1_9.rb
  3. +5 −0 spec/mail/encodings_spec.rb
View
@@ -1,6 +1,7 @@
== HEAD
Features:
+* Alias shift-jis charset to Shift_JIS Ruby encoding (jeremy)
* Add support for ks_c_5601-1987 charset, aliased to CP949 Ruby encoding (jeremy)
* Don't allow colons in header names (jeremy)
* Can assign arrays of Message-IDs to References and In-Reply-To (jeremy)
@@ -128,6 +128,10 @@ def Ruby19.pick_encoding(charset)
when 'ks_c_5601-1987'
Encoding::CP949
+ # Wrongly written Shift_JIS (Japanese)
+ when 'shift-jis'
+ Encoding::Shift_JIS
+
else
charset
end
@@ -160,6 +160,11 @@
string = '=?ks_c_5601-1987?B?seggx/bB+A==?= <a@b.org>'.force_encoding('us-ascii')
Mail::Encodings.value_decode(string).should == "김 현진 <a@b.org>"
end
+
+ it "should decode shift-jis encoded string" do
+ string = '=?shift-jis?Q?=93=FA=96{=8C=EA=?='.force_encoding('us-ascii')
+ Mail::Encodings.value_decode(string).should == "日本語"
+ end
end
end

0 comments on commit 02bb613

Please sign in to comment.