Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
use String#encode instead of Iconv.conv
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 20, 2016
1 parent 38c8f71 commit c3e7d63
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion Gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions Gemfile.lock

This file was deleted.

@@ -1,9 +1,8 @@
require 'iconv'
MailHandler.class_eval do
def dispatch_with_ruby_lang_mailing_list_customization
if charset = email.header.charset and charset.downcase != 'utf-8'
email.body = Iconv.conv("UTF-8", charset, email.body) rescue nil
email.subject = Iconv.conv("UTF-8", charset, email.subject) rescue nil
email.body = email.body.encode("UTF-8", charset) rescue nil
email.subject = email.subject.encode("UTF-8", charset) rescue nil
end
email.subject = email.subject.sub(/\[#{Regexp.escape driver.mailing_list.identifier}:\d+\]/, '')
if subject_tag_re =~ email.subject
Expand Down

0 comments on commit c3e7d63

Please sign in to comment.