From f8c983851e4439dc1ce050e18a70bfcdcc5bd909 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Tue, 26 Oct 2010 00:09:02 +0200
Subject: [PATCH] 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>.
---
 lib/sup/modes/edit-message-mode.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 86aef4b..28082c3 100644
--- 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}?="
-- 
1.7.1

