sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit d884dd47cf8b4e9d14159f3fb1dbc3191cac4f6f
parent ffb641e0d5b4f661014706833c9b0211f115513c
Author: Michael Stapelberg <michael@stapelberg.de>
Date:   Tue, 26 Oct 2010 00:09:02 +0200

Bugfix: mime_encode: Encode _ as =5F instead of =96

This line of code was introduced in 0d45aa38, probably by mistake. The ASCII
code in decimal for '_' (underscore) is 95 (the code says 96, but probably
another mistake), but as mime encoding is hexadecimal, we need =5F instead.

An example of this encoding problem can be seen in one of my earlier patches
with message-id <1287565270-sup-1161@midna.zekjur.net>.

Diffstat:
M lib/sup/modes/edit-message-mode.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -218,7 +218,7 @@ protected
   def mime_encode string
     string = [string].pack('M') # basic quoted-printable
     string.gsub!(/=\n/,'')      # .. remove trailing newline
-    string.gsub!(/_/,'=96')     # .. encode underscores
+    string.gsub!(/_/,'=5F')     # .. encode underscores
     string.gsub!(/\?/,'=3F')    # .. encode question marks
     string.gsub!(/ /,'_')       # .. translate space to underscores
     "=?utf-8?q?#{string}?="