https://github.com/mikel/mail
Ruby
A Really Ruby Mail Library
Mail::Ruby19.pick_encoding
Pick a Ruby encoding corresponding to the message charset. Most
charsets have a Ruby encoding, but some need manual aliasing here.
TODO: add this as a test somewhere:
Encoding.list.map { |e| [e.to_s.upcase == pick_encoding(e.to_s.downcase.gsub("-", "")), e.to_s] }.select {|a,b| !b}
Encoding.list.map { |e| [e.to_s == pick_encoding(e.to_s), e.to_s] }.select {|a,b| !b}Edit
git clone [email protected]:mikel/mail.git
cd mail
open lib/mail/version_specific/ruby_1_9.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Mail--Ruby19-pick_encoding-for-pr
# Commit to gitgit add lib/mail/version_specific/ruby_1_9.rbgit commit -m "better docs for Mail::Ruby19.pick_encoding"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Mail--Ruby19-pick_encoding-for-pr
hub pull-request
# Celebrate!