sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit c6498df4241233864ed90f20781cfd9a65cf4176
parent 9286229b213af150b5d906d5c75468683e91e9a2
Author: Gaute Hope <eg@gaute.vetsj.com>
Date:   Tue,  9 Nov 2010 11:06:04 +0100

Force UTF-8 in ask_many_emails..

A mix-up occurs when you first tab complete a UTF-8 contact, then try to
complete an ASCII encoded contact.

They are all stored as UTF-8 in file and when loaded - but will
apparently be converted to ASCII if possible when a Person object is
created.

Diffstat:
M lib/sup/buffer.rb | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -481,7 +481,10 @@ EOS
       prefix, target = partial.split_on_commas_with_remainder
       target ||= prefix.pop || ""
       target.force_encoding 'UTF-8' if target.methods.include?(:encoding)
+
       prefix = prefix.join(", ") + (prefix.empty? ? "" : ", ")
+      prefix.force_encoding 'UTF-8' if prefix.methods.include?(:encoding)
+
       completions.select { |x| x =~ /^#{Regexp::escape target}/i }.sort_by { |c| [ContactManager.contact_for(c) ? 0 : 1, c] }.map { |x| [prefix + x, x] }
     end
   end