diff options
author | Jan Engelhardt <[email protected]> | 2024-05-21 13:45:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-21 13:45:29 +0000 |
commit | 97d15b8cd77998f37c279a023aa9f07def956e60 (patch) | |
tree | a59028d321a5ecbdf3ee59887810bd1feb1f4ca3 /tests | |
parent | Resolve compiler warnings (#302) (diff) | |
download | vmime-97d15b8cd77998f37c279a023aa9f07def956e60.tar.gz vmime-97d15b8cd77998f37c279a023aa9f07def956e60.zip |
vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F (#303)
* vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F
Do not switch to QP/B64 when encountering U+007F.
U+007F is part of ASCII just as much as U+0001 is.
---------
Co-authored-by: Vincent Richard <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/charsetTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/parser/charsetTest.cpp b/tests/parser/charsetTest.cpp index 01b04e11..362cb5f0 100644 --- a/tests/parser/charsetTest.cpp +++ b/tests/parser/charsetTest.cpp @@ -36,6 +36,7 @@ VMIME_TEST_SUITE_BEGIN(charsetTest) VMIME_TEST(testConvertStreamValid) VMIME_TEST(testConvertStreamExtract) VMIME_TEST(testEncodingHebrew1255) + //VMIME_TEST(testEncodingSelectionOnASCII) // IDNA VMIME_TEST(testEncodeIDNA) @@ -141,6 +142,16 @@ VMIME_TEST_SUITE_BEGIN(charsetTest) VASSERT_EQ("1", "=?windows-1255?B?6fn3+On5+Pfp6fk=?=", encoded); } +#if 0 /* decideImpl is not public */ + void testEncodingSelectionOnASCII() { + + const std::string a = "Hi\x01!", b = "Hi\x7f!"; + VASSERT_EQ("1", vmime::encoding::decideImpl(std::begin(a), std::end(a)), + vmime::encoding::decideImpl(std::begin(b), std::end(b))); + + } +#endif + static const vmime::string convertHelper( const vmime::string& in, const vmime::charset& csrc, |