Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charset ks_c_5601-1987 is not supported #436

Closed
donaldpiret opened this issue Sep 26, 2012 · 6 comments
Closed

Charset ks_c_5601-1987 is not supported #436

donaldpiret opened this issue Sep 26, 2012 · 6 comments

Comments

@donaldpiret
Copy link

We've been receiving incoming emails with charset "ks_c_5601-1987" (looks to be Korean) that mail chokes on with the following error:

ArgumentError:
       unknown encoding name - ks_c_5601-1987
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/version_specific/ruby_1_9.rb:56:in `force_encoding'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/version_specific/ruby_1_9.rb:56:in `b_value_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:248:in `b_value_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:137:in `block (2 levels) in value_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:130:in `map'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:130:in `block in value_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:122:in `map'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:122:in `value_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/encodings.rb:101:in `decode_encode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:64:in `do_decode'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:46:in `decoded'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:50:in `default'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/field.rb:133:in `method_missing'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1107:in `default'
     # /Users/donald/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1042:in `subject'

Here is the content of the email:

Delivered-To: roomorama+1-1-b9e28d94@roomorama.com
Received: by 10.112.31.232 with SMTP id d8csp335407lbi;
        Tue, 25 Sep 2012 01:34:51 -0700 (PDT)
Received: by 10.68.130.194 with SMTP id og2mr27152769pbb.131.1348562089974;
        Tue, 25 Sep 2012 01:34:49 -0700 (PDT)
Return-Path: <hjkim@kimkoo.org>
Received: from sniper.bing.co.kr (mail.bing.co.kr. [211.38.186.2])
        by mx.google.com with ESMTPS id rl8si5249475pbc.292.2012.09.25.01.34.47
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 25 Sep 2012 01:34:49 -0700 (PDT)
Received-SPF: neutral (google.com: 211.38.186.2 is neither permitted nor denied by best guess record for domain of hjkim@kimkoo.org) client-ip=211.38.186.2;
Authentication-Results: mx.google.com; spf=neutral (google.com: 211.38.186.2 is neither permitted nor denied by best guess record for domain of hjkim@kimkoo.org) smtp.mail=hjkim@kimkoo.org
Received: (snipe 5506 invoked by alias); 25 Sep 2012 17:34:38 +0900
Received: from unknown (HELO kimkoosite.kimkooo.local) (192.168.102.4)
    by 10.3.0.250 with SMTP; 25 Sep 2012 17:34:38 +0900
Subject: =?ks_c_5601-1987?B?UkU6IMi4v/i01LKyIEVyc2m01MDMILjevcPB9rimILq4s8K9wLTP?=
    =?ks_c_5601-1987?B?tNku?=
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="----_=_NextPart_001_01CD9AF8.9DBAB545"
Content-class: urn:content-classes:message
Date: Tue, 25 Sep 2012 17:34:45 +0900
X-MimeOLE: Produced By Microsoft Exchange V6.5
Message-ID: <2F2CA0B44216D6429854A4D08B244D9604D322@kimkoosite.kimkooo.local>
X-MS-Has-Attach:
X-MS-TNEF-Correlator: <2F2CA0B44216D6429854A4D08B244D9604D322@kimkoosite.kimkooo.local>
Thread-Topic: =?ks_c_5601-1987?B?yLi/+LTUsrIgRXJzabTUwMwguN69w8H2uKYgurizwr3AtM+02S4=?=
Thread-Index: Ac2aNMUA8IL//1ZlTTOb9hbb8f899QAwgC09
References: <inquiries/751635@roomorama.com> <inquiries/751635/1979946@roomorama.com>
From: =?ks_c_5601-1987?B?seggx/bB+A==?= <hjkim@kimkoo.org>
To: "Roomorama" <roomorama+1-1-b9e28d94@roomorama.com>

This is a multi-part message in MIME format.

------_=_NextPart_001_01CD9AF8.9DBAB545
Content-Type: text/plain;
    charset="ks_c_5601-1987"
Content-Transfer-Encoding: quoted-printable

<snip>

------_=_NextPart_001_01CD9AF8.9DBAB545--
@ochko
Copy link
Contributor

ochko commented Nov 6, 2012

I have got this error too

@radar
Copy link
Contributor

radar commented Nov 16, 2012

It doesn't look like this encoding is supported by Ruby at all (as of 1.9.3p327). This issue could potentially be a Ruby bug.

List of encodings from Encoding.list call:

["ASCII-8BIT", "Big5", "Big5-HKSCS", "Big5-UAO", "CP50220", "CP50221", "CP51932", "CP850", "CP852", "CP855", "CP949", "CP950", "CP951", "EUC-JP", "EUC-KR", "EUC-TW", "Emacs-Mule", "GB12345", "GB18030", "GB1988", "GB2312", "GBK", "IBM437", "IBM737", "IBM775", "IBM852", "IBM855", "IBM857", "IBM860", "IBM861", "IBM862", "IBM863", "IBM864", "IBM865", "IBM866", "IBM869", "ISO-2022-JP", "ISO-2022-JP-2", "ISO-2022-JP-KDDI", "ISO-8859-1", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "KOI8-R", "KOI8-U", "MacJapanese", "SJIS-DoCoMo", "SJIS-KDDI", "SJIS-SoftBank", "Shift_JIS", "TIS-620", "US-ASCII", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", "UTF-32LE", "UTF-7", "UTF-8", "UTF8-DoCoMo", "UTF8-KDDI", "UTF8-MAC", "UTF8-SoftBank", "Windows-1250", "Windows-1251", "Windows-1252", "Windows-1253", "Windows-1254", "Windows-1255", "Windows-1256", "Windows-1257", "Windows-1258", "Windows-31J", "Windows-874", "eucJP-ms", "macCentEuro", "macCroatian", "macCyrillic", "macGreek", "macIceland", "macRoman", "macRomania", "macThai", "macTurkish", "macUkraine", "stateless-ISO-2022-JP", "stateless-ISO-2022-JP-KDDI"] 

@Tony1956
Copy link

We've been getting these on another system...probably some webmail client. If it's possible in Ruby, this charset should be mapped to CP949

@jeremy
Copy link
Collaborator

jeremy commented Jan 26, 2013

Some backstory: http://lists.kde.org/?l=kde-i18n-doc&m=100396886120761&w=2

Apparently ks_c_5601-1987 can be treated as EUC-KR.

@glongman
Copy link

glongman commented May 1, 2013

has this been released? We are running 2.5.2 2.5.3 and are having this issue

Edit: (typo) we are running 2.5.3!

@jimmysoho
Copy link

Just ran into this one too. We are on ruby 2.3.1. The fix was made in Mail::Ruby19 Ruby19.pick_encoding. But it seems this fix is also needed in ruby 2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants