sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 4701831a64d57d5a266578d4b9697efd180415dc
parent f627117a86d37c270ad3e30a5c9dfd37c39f947c
Author: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Date:   Tue,  8 Jan 2008 02:42:56 +0100

encoding, fix: Normalize UTF8 and UTF_8 to utf8, to please iconv.

Signed-off-by: William Morgan 

Diffstat:
M lib/sup/message.rb | 1 +
M lib/sup/rfc2047.rb | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -391,6 +391,7 @@ private
   end
 
   def self.convert_from body, charset
+    charset = "utf-8" if charset =~ /UTF_?8/i
     begin
       raise MessageFormatError, "RubyMail decode returned a null body" unless body
       return body unless charset
diff --git a/lib/sup/rfc2047.rb b/lib/sup/rfc2047.rb
@@ -52,6 +52,8 @@ module Rfc2047
         # WORD.
       end
 
+      charset = "utf-8" if charset =~ /UTF_?8/i
+
       # Convert:
       #
       # Remember - Iconv.open(to, from)!