diff options
author | Vincent Richard <[email protected]> | 2011-03-31 19:13:03 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2011-03-31 19:13:03 +0000 |
commit | d7c2fb2e5832a509ce4fccfd4aaf6f42a1c94361 (patch) | |
tree | 1c3a33e7356c6ce229c076a197ef0afc39198042 /tests/parser/charsetTest.cpp | |
parent | Allow static linking in mingw-cross-env. Added 'iconv' and uses 'ws2_32' inst... (diff) | |
download | vmime-d7c2fb2e5832a509ce4fccfd4aaf6f42a1c94361.tar.gz vmime-d7c2fb2e5832a509ce4fccfd4aaf6f42a1c94361.zip |
Flush stateful data from iconv (thanks to John van der Kamp, Zarafa).
Diffstat (limited to 'tests/parser/charsetTest.cpp')
-rw-r--r-- | tests/parser/charsetTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/parser/charsetTest.cpp b/tests/parser/charsetTest.cpp index 8ad71d7c..54a09a71 100644 --- a/tests/parser/charsetTest.cpp +++ b/tests/parser/charsetTest.cpp @@ -100,6 +100,7 @@ VMIME_TEST_SUITE_BEGIN VMIME_TEST(testFilterValid1) VMIME_TEST(testFilterValid2) VMIME_TEST(testFilterValid3) + VMIME_TEST(testEncodingHebrew1255) // Test invalid input VMIME_TEST(testFilterInvalid1) @@ -227,6 +228,15 @@ VMIME_TEST_SUITE_BEGIN VASSERT_EQ("1", toHex(expectedOut), toHex(actualOut)); } + void testEncodingHebrew1255() + { + // hewbrew string in windows-1255 charset + const char data[] = "\xe9\xf9\xf7\xf8\xe9\xf9\xf8\xf7\xe9\xe9\xf9"; + vmime::word w = vmime::word(data, "windows-1255"); + vmime::string encoded = w.generate(); + // less than 60% ascii, base64 received + VASSERT_EQ("1", "=?windows-1255?B?6fn3+On5+Pfp6fk=?=", encoded); + } // Conversion to hexadecimal for easier debugging static const vmime::string toHex(const vmime::string str) |