Patch #15785
closedSupport more character encodings in incoming emails
Description
The MailHandler currently tries to convert the encoding of the body of incoming emails to UTF-8 by directly passing the charset of the email body to Redmine::CodesetUtil.to_utf8, see source:/trunk/app/models/mail_handler.rb@12473#L413. Redmine::CodesetUtil.to_utf8 in turn only handles encodings known to Ruby (on 1.9+), which might not be the case for the charset of an incoming email.
Planio recently had the case of a user sending emails in Korean with the charset ks_c_5601-1987, which Ruby doesn't know about. This can be mitigated thanks to Mail::RubyVer.pick_encoding which will try to pick a Ruby encoding compatible with the charset of the email (Mail::RubyVer is a wrapper for the correct functions for the current Ruby version).
I will post a patch for this shortly.
Files