diff options
| author | Vincent Richard <[email protected]> | 2020-12-12 13:19:58 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-12 13:19:58 +0000 |
| commit | 9e2c286c0b2a7f1c3225b994a419c43a13ce55a9 (patch) | |
| tree | 3b2a523a15513324175c40dec2dad1747c9dc0ef /src | |
| parent | Check for DSN extension support before using it. (diff) | |
| parent | Avoid force-encoding display names that fit within qcontent (diff) | |
| download | vmime-9e2c286c0b2a7f1c3225b994a419c43a13ce55a9.tar.gz vmime-9e2c286c0b2a7f1c3225b994a419c43a13ce55a9.zip | |
Merge pull request #246 from jengelh/asciiquote
Avoid force-encoding display names that fit within qcontent
Diffstat (limited to 'src')
| -rw-r--r-- | src/vmime/mailbox.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/vmime/mailbox.cpp b/src/vmime/mailbox.cpp index db5cc74e..30a082ea 100644 --- a/src/vmime/mailbox.cpp +++ b/src/vmime/mailbox.cpp @@ -355,44 +355,14 @@ void mailbox::generateImpl( // - if it contains characters in a charset different from "US-ASCII", // - and/or if it contains one or more of these special chars: // CR LF TAB " ; , < > ( ) @ / ? . = : - + // these special chars only require quoting, not full encoding // Check whether there are words that are not "US-ASCII" // and/or contain the special chars. bool forceEncode = false; for (size_t w = 0 ; !forceEncode && w != m_name.getWordCount() ; ++w) { - if (m_name.getWordAt(w)->getCharset() == charset(charsets::US_ASCII)) { - - const string& buffer = m_name.getWordAt(w)->getBuffer(); - - for (string::const_iterator c = buffer.begin() ; - !forceEncode && c != buffer.end() ; ++c) { - - switch (*c) { - - case '\r': - case '\n': - case '\t': - case ';': - case ',': - case '<': case '>': - case '(': case ')': - case '@': - case '/': - case '?': - case '.': - case '=': - case ':': - case '"': - - forceEncode = true; - break; - } - } - - } else { - + if (m_name.getWordAt(w)->getCharset() != charset(charsets::US_ASCII)) { forceEncode = true; } } |
