Replace unicode.h/unicode.cpp by the UTF8-CPP library.

unicode.h/unicode.cpp are no longer maintained and incompatible with Debian's guideline.
UTF8-CPP is maintained on GitHub and published under the Boost Software License which is compatible with either LGPL or MPL and should go along with Debian's guideline.
This commit is contained in:
Tsuda Kageyu
2017-01-27 11:44:56 +09:00
parent 586c9bd962
commit 0c45c63943
7 changed files with 682 additions and 542 deletions

View File

@ -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(testRedundantUTF8);
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";