Implemented string conversion from Latin-1 to Unicode

This commit is contained in:
Daniel Wolf
2016-06-02 22:21:37 +02:00
parent 4d45bf7c89
commit 8be6485685
3 changed files with 20 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
using namespace testing;
using std::string;
using std::wstring;
// splitIntoLines
@@ -72,6 +73,14 @@ TEST(wrapString, basic) {
EXPECT_THAT(wrapString("\n\nLine no 3\n\nLine no 4\n", 8), ElementsAre("", "", "Line no", "3", "", "Line no", "4", ""));
}
// latin1ToWide
TEST(latin1ToWide, basic) {
string pangramLatin1 = "D\350s No\353l o\371 un z\351phyr ha\357 me v\352t de gla\347ons w\374rmiens, je d\356ne d'exquis r\364tis de boeuf au kir \340 l'a\377 d'\342ge m\373r & c\346tera!";
wstring pangramWide = L"Dès Noël où un zéphyr haï me vêt de glaçons würmiens, je dîne d'exquis rôtis de boeuf au kir à l'aÿ d'âge mûr & cætera!";
EXPECT_EQ(pangramWide, latin1ToWide(pangramLatin1));
}
// toASCII
TEST(toASCII, string) {