1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 02:46:57 +01:00

Test for UTF8 in a Latin1 field

This commit is contained in:
David Sansome 2010-06-02 13:11:51 +00:00
parent f4385d4545
commit 21c990e3c7

View File

@ -129,4 +129,12 @@ TEST_F(SongTest, DoesNotFixExtendedAscii) {
EXPECT_EQ(fixed, unicode);
}
TEST_F(SongTest, FixesUtf8MungedIntoLatin1) {
char latin1[] = { 'E', 's', 't', 'h', 'e', 'r', 0xe2, 0x80, 0x99, 's', 0x00 };
TagLib::String str(latin1, TagLib::String::Latin1);
QString fixed = UniversalEncodingHandler::FixEncoding(str);
EXPECT_EQ(8, fixed.length());
EXPECT_EQ(QString::fromUtf8("Esthers"), fixed);
}
} // namespace