Defect #24910

Issue processing UTF7 mails

Added by Falk Eckert over 5 years ago. Updated almost 2 years ago.

Status:NewStart date:
Priority:LowDue date:
Assignee:-% Done:


Category:Email receiving
Target version:-
Resolution: Affected version:



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?


converter_not_found.patch Magnifier (1.45 KB) Karel Pičman, 2020-09-14 13:27

converter_not_found2.patch Magnifier (2.78 KB) Karel Pičman, 2020-09-17 14:37


#1 Updated by Go MAEDA over 5 years ago

  • Category set to Email receiving

#2 Updated by Toshi MARUYAMA over 5 years ago

$ cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)

$ irb
1.9.3-p551 :001 > str = "test".force_encoding("UTF-7")
 => "\x74\x65\x73\x74" 
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 (irb):2
    from /home/xxxx/.rvm/rubies/ruby-1.9.3-p551/bin/irb:12:in `<main>'

#3 Updated by Toshi MARUYAMA over 5 years ago

  • Priority changed from Normal to Low

It seems Ruby does not have UTF-7 converter.

"Code converter not found (UTF-8 to EUC-TW)":

#4 Updated by Fred Sanger over 5 years ago

This encyclopedia article for UTF7 seems to be a good place to start

#5 Updated by Pavel Rosický over 5 years ago

@Toshi: utf-7 is relevant only for email processing. Ruby still supports it, but it's a little bit tricky. This will work:

require "net/imap" 

#6 Updated by Karel Pičman almost 2 years ago

The same problem with Windows-1258. Attached patch should cover all not supported code pages.

#7 Updated by Pavel Rosický almost 2 years ago

could you add a more realistic test case with an email as a fixture?

it should be already fixed by

#8 Updated by Karel Pičman almost 2 years ago

A test with a real Vietnamese email added into the patch.

Also available in: Atom PDF