Skip to content

Commit 068a7d7

Browse files
committed
support MS950 encoding
close #1406
1 parent c9ea62c commit 068a7d7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/mail/utilities.rb

+4
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ def Utilities.pick_encoding(charset)
526526
when 'latin2'
527527
Encoding::ISO_8859_2
528528

529+
# Microsoft-specific alias for CP950 (Traditional Chinese)
530+
when 'ms950'
531+
Encoding::CP950
532+
529533
else
530534
charset
531535
end

spec/mail/encoding_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
"latin2" => Encoding::ISO_8859_2,
207207
"ISO_8859-1" => Encoding::ISO_8859_1,
208208
"cp-850" => Encoding::CP850,
209+
"MS950" => Encoding::CP950,
209210
"" => Encoding::BINARY
210211
}.each do |from, to|
211212
it "should support #{from}" do

0 commit comments

Comments
 (0)