fixed MimeHeader.hasToBeEncoded() to include TAB.

bug encounted when replying to a message such as:
From: "bar,	foo" <foobar@example.com>
the field was originally folded on the tab, but the CRLF was already stripped before this error.
This commit is contained in:
ashley willis 2012-04-30 13:58:02 -05:00
parent 5d080b656d
commit 9e1fa63139
1 changed files with 2 additions and 2 deletions

View File

@ -118,12 +118,12 @@ public class MimeHeader {
writer.flush();
}
// encode non printable characters except LF/CR codes.
// encode non printable characters except LF/CR/TAB codes.
public boolean hasToBeEncoded(String text) {
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c < 0x20 || 0x7e < c) { // non printable
if (c != 0x0a && c != 0x0d) { // non LF/CR
if (c != 0x0a && c != 0x0d && c != 0x09) { // non LF/CR/TAB
return true;
}
}