mail_encoding_patch.rb 373 B

123456789101112131415161718
  1. module Mail
  2. class Ruby19
  3. class ImprovedEncoder < BestEffortCharsetEncoder
  4. def pick_encoding(charset)
  5. case charset
  6. when /\Aiso-2022-jp\z/i
  7. Encoding::CP50220
  8. when /\Ashift_jis\z/i
  9. Encoding::Windows_31J
  10. else
  11. super
  12. end
  13. end
  14. end
  15. self.charset_encoder = ImprovedEncoder.new
  16. end
  17. end