diff --git a/lib/mail/multibyte/chars.rb b/lib/mail/multibyte/chars.rb index f65e69d5f..14306d6b5 100644 --- a/lib/mail/multibyte/chars.rb +++ b/lib/mail/multibyte/chars.rb @@ -339,7 +339,7 @@ def limit(limit) # Example: # 'Laurent, où sont les tests ?'.mb_chars.upcase.to_s # => "LAURENT, OÙ SONT LES TESTS ?" def upcase - chars(Unicode.apply_mapping(@wrapped_string), :uppercase_mapping) + chars(Unicode.apply_mapping(@wrapped_string, :uppercase_mapping)) end # Convert characters in the string to lowercase. @@ -347,7 +347,7 @@ def upcase # Example: # 'VĚDA A VÝZKUM'.mb_chars.downcase.to_s # => "věda a výzkum" def downcase - chars(Unicode.apply_mapping(@wrapped_string), :lowercase_mapping) + chars(Unicode.apply_mapping(@wrapped_string, :lowercase_mapping)) end # Converts the first character to uppercase and the remainder to lowercase. diff --git a/spec/mail/multibyte_spec.rb b/spec/mail/multibyte_spec.rb new file mode 100644 index 000000000..cff7079a5 --- /dev/null +++ b/spec/mail/multibyte_spec.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +require 'spec_helper' + +describe "multibyte/chars" do + Chars = Mail::Multibyte::Chars + + it "should upcase" do + chars = Chars.new('Laurent, où sont les tests ?') + chars.upcase.should == "LAURENT, OÙ SONT LES TESTS ?" + end + + it "should downcase" do + chars = Chars.new('VĚDA A VÝZKUM') + chars.downcase.should == "věda a výzkum" + end +end +