sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit fa3b0db82bb00e0e2c1534c630938e9fae187c3a
parent ae3f024bcbd29f93c58f95b649e4b90b433fd118
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sun, 28 Feb 2010 12:08:05 -0800

force UTF8 on strings read from ask and account names in the config file

Diffstat:
M lib/sup/account.rb | 2 ++
M lib/sup/buffer.rb | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/account.rb b/lib/sup/account.rb
@@ -50,6 +50,8 @@ class AccountManager
     end
     hash[:alternates] ||= []
 
+    [:name, :signature].each { |x| hash[x].force_encoding Encoding::UTF_8 if hash[x].respond_to? :encoding }
+
     a = Account.new hash
     @accounts[a] = true
 
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -612,7 +612,7 @@ EOS
       tf.deactivate
       draw_screen :sync => false, :status => status, :title => title
     end
-    tf.value
+    tf.value.tap { |x| x.force_encoding Encoding::UTF_8 if x && x.respond_to?(:encoding) }
   end
 
   def ask_getch question, accept=nil