mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
String simplification (accent removal) using Unicode decomposition
This commit is contained in:
@@ -36,6 +36,7 @@ namespace BlackMiscTest
|
||||
void testSplit();
|
||||
void testTimestampParsing();
|
||||
void testCodecs();
|
||||
void testSimplify();
|
||||
};
|
||||
|
||||
void CTestStringUtils::testRemove()
|
||||
@@ -157,6 +158,14 @@ namespace BlackMiscTest
|
||||
QVERIFY2(okRu1, "Russian \"test\" equal after round-trip with cp1251");
|
||||
QVERIFY2(okRu2, "Russian \"test\" equal after round-trip with utf8");
|
||||
}
|
||||
|
||||
void CTestStringUtils::testSimplify()
|
||||
{
|
||||
const QString input = QString::fromUtf8(u8"ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿ");
|
||||
const QString output = QLatin1String("SZszYAAAAAACEEEEIIIINOOOOOUUUUYaaaaaaceeeeiiiinooooouuuuyy");
|
||||
QCOMPARE(simplifyAccents(input), output);
|
||||
QCOMPARE(simplifyByDecomposition(input), output);
|
||||
}
|
||||
}
|
||||
|
||||
//! main
|
||||
|
||||
Reference in New Issue
Block a user