Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 20 Aug 2011 11:58:57 +0000 (11:58 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 20 Aug 2011 11:58:57 +0000 (11:58 +0000)
libcitadel/lib/stringbuf.c

index 273c09ecb2d320f28a5c8f0aa3e31cf5eaf9a387..d4b2e666f1a289d6cde8da087e1bbc0d0f3a452f 100644 (file)
@@ -2680,6 +2680,8 @@ int StrBufRFC2047encode(StrBuf **target, const StrBuf *source)
                    (ch  > 126) || 
                    (ch ==  61) ||
                    (ch == '=') ||
+                    (ch == '?') ||
+                   (ch == '_') ||
                    (ch == '[') ||
                    (ch == ']')   )
                {
@@ -2687,7 +2689,10 @@ int StrBufRFC2047encode(StrBuf **target, const StrBuf *source)
                        (*target)->BufUsed += 3;
                }
                else {
-                       (*target)->buf[(*target)->BufUsed] = ch;
+                       if (ch == ' ')
+                               (*target)->buf[(*target)->BufUsed] = '_';
+                       else
+                               (*target)->buf[(*target)->BufUsed] = ch;
                        (*target)->BufUsed++;
                }
        }