Issue processing UTF7 mails
Added by Falk Eckert over 6 years ago.
Updated over 2 years ago.
we have an issue with processing UTF7 mails:
exception: code converter not found (UTF-7 to UTF-8)
["/srv/redmine/public_html/lib/redmine/codeset_util.rb:25:in `encode'", "/srv/redmine/public_html/lib/redmine/codeset_util.rb:25:in `to_utf8'"
Are there any ideas to solve this issue?
- Category set to Email receiving
$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
1.9.3-p551 :001 > str = "test".force_encoding("UTF-7")
1.9.3-p551 :002 > str = str.encode("UTF-8", :invalid => :replace,:undef => :replace, :replace => '?')
Encoding::ConverterNotFoundError: code converter not found (UTF-7 to UTF-8)
from (irb):2:in `encode'
from /home/xxxx/.rvm/rubies/ruby-1.9.3-p551/bin/irb:12:in `<main>'
- Priority changed from Normal to Low
This encyclopedia article for UTF7 seems to be a good place to start
toshio harita: utf-7 is relevant only for email processing. Ruby still supports it, but it's a little bit tricky. This will work:
The same problem with Windows-1258. Attached patch should cover all not supported code pages.
A test with a real Vietnamese email added into the patch.
Also available in: Atom