Permalink
Browse files

Follow up to #2456 - removed unnessary call to Mail::Encodings.value_…

…decode and corrected test cases
  • Loading branch information...
SummerStorm committed Jan 30, 2019
1 parent d6d4b6b commit 0b472fae6754e25c0ab9de19abcdc2bd62c0d336
@@ -508,7 +508,7 @@ def message_header_hash(mail)

h['x-any-recipient'] = h.values.select(&:present?).join(', ')
h['message_id'] = imported_fields['message-id']
h['subject'] = Mail::Encodings.value_decode(imported_fields['subject'])
h['subject'] = imported_fields['subject']
begin
h['date'] = Time.zone.parse(mail.date.to_s) || imported_fields['date']
rescue
@@ -170,7 +170,7 @@ def mock_mail(number_of_links)
end

it 'decode utf-8 encoded strings' do
expect( Mail::Encodings.value_decode('=?UTF-8?Q?Personal=C3=A4nderung?=') ).to eql( 'Personaländerung' )
expect( Mail::Encodings.value_decode('=?UTF-8?Q? Personal=C3=A4nderung?=') ).to eql( ' Personaländerung' )
end
end
end
@@ -5,7 +5,7 @@ Delivered-To: box@samba.example.com
Received: from me.home (1-2-1-1.adsl.highway.example.com [1.2.1.1])
by samba.example.com (Postfix) with ESMTPSA id C96F8500D3D
for <info@example.com>; Thu, 3 May 2012 12:04:28 +0100 (BST)
Subject: =?UTF-8?Q?Personal=C3=A4nderung?=
Subject: =?UTF-8?Q? Personal=C3=A4nderung?=
From: <John.Smith@example.com>
Content-Type: text/plain;
charset=iso-8859-1
@@ -1,2 +1,2 @@
--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
subject: Personaländerung
subject: ' Personaländerung'

0 comments on commit 0b472fa

Please sign in to comment.