From 0a60b4cec8405ee70c1cbc06028b4d856d1843d6 Mon Sep 17 00:00:00 2001 From: oz Date: Fri, 4 Dec 2020 21:14:51 +0100 Subject: [PATCH 1/2] Fix duplicated character class range --- lib/rfc2047.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rfc2047.rb b/lib/rfc2047.rb index 16746fc..9391c3b 100644 --- a/lib/rfc2047.rb +++ b/lib/rfc2047.rb @@ -15,7 +15,7 @@ module Rfc2047 WORD = /=\?([!#$\%&'*+-\/0-9A-Z\\^\`a-z{|}~]+)\?([BbQq])\?([!->@-~]+)\?=/ # :nodoc: # Look for two adjacent words in the same encoding. - ADJACENT_WORDS = /(#{WORD})[\s\r\n]+(?==\?(\2)\?([BbQq])\?)/ + ADJACENT_WORDS = /(#{WORD})\s+(?==\?(\2)\?([BbQq])\?)/ # Decodes a string, +from+, containing RFC 2047 encoded words into a target # character set, +target+ defaulting to utf-8. See iconv_open(3) for information on the From fd03a23165a48fc54cd2260a246862fedefcd75c Mon Sep 17 00:00:00 2001 From: oz Date: Fri, 4 Dec 2020 21:22:58 +0100 Subject: [PATCH 2/2] Fix testcase related warning (dupl. hash key) --- test/rfc2047_test.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/rfc2047_test.rb b/test/rfc2047_test.rb index 4a01df7..10db2db 100644 --- a/test/rfc2047_test.rb +++ b/test/rfc2047_test.rb @@ -44,8 +44,7 @@ def test_cases '=?US-ASCII?Q?Keith_Moore?= ' => { 'utf-8' => 'Keith Moore ', 'ascii' => 'Keith Moore ', - 'us-ascii' => 'Keith Moore ', - 'ascii' => 'Keith Moore ', + 'us-ascii' => 'Keith Moore ' }, '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ' => {