diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2017-01-30 12:54:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 12:54:43 +0900 |
commit | 6a61f02f85340cb6e9ea12a160f2ad16a9fe640e (patch) | |
tree | b33cc393f3ddbab6a90a42b290cca62eb5d3eb09 /tests | |
parent | 038b52ae01060089ee6d260e83df258725d8c1d4 (diff) | |
parent | 598ab752bc682375340d8a13ee81da7ee496c960 (diff) |
Merge pull request #794 from TsudaKageyu/utf8-library
Replace unicode.h/unicode.cpp by the UTF8-CPP library.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_string.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_string.cpp b/tests/test_string.cpp index e460bfa1..0ade0113 100644 --- a/tests/test_string.cpp +++ b/tests/test_string.cpp @@ -49,6 +49,7 @@ class TestString : public CppUnit::TestFixture CPPUNIT_TEST(testUpper); CPPUNIT_TEST(testEncodeNonLatin1); CPPUNIT_TEST(testEncodeEmpty); + CPPUNIT_TEST(testEncodeNonBMP); CPPUNIT_TEST(testIterator); CPPUNIT_TEST(testInvalidUTF8); CPPUNIT_TEST_SUITE_END(); @@ -313,6 +314,13 @@ public: CPPUNIT_ASSERT(empty.to8Bit(true).empty()); } + void testEncodeNonBMP() + { + const ByteVector a("\xFF\xFE\x3C\xD8\x50\xDD\x40\xD8\xF5\xDC\x3C\xD8\x00\xDE", 14); + const ByteVector b("\xF0\x9F\x85\x90\xF0\xA0\x83\xB5\xF0\x9F\x88\x80"); + CPPUNIT_ASSERT_EQUAL(b, String(a, String::UTF16).data(String::UTF8)); + } + void testIterator() { String s1 = "taglib string"; |