diff --git a/test/ebml/test00.cpp b/test/ebml/test00.cpp index 3c02481b..0b9d5013 100644 --- a/test/ebml/test00.cpp +++ b/test/ebml/test00.cpp @@ -73,7 +73,7 @@ int main(void) KaxFileName * pFileName1 = static_cast(pAttachment1->FindFirstElt(EBML_INFO(KaxFileName), true)); if (pFileName1 == NULL) return -1; - *static_cast(pFileName1) = L"file1.txt"; + *static_cast(pFileName1) = UTFstring{L"file1.txt"}; KaxFileData * pFileData1 = static_cast(pAttachment1->FindFirstElt(EBML_INFO(KaxFileData), true)); if (pFileData1 == NULL) return -1; @@ -88,7 +88,7 @@ int main(void) KaxFileName * pFileName2 = static_cast(pAttachment2->FindFirstElt(EBML_INFO(KaxFileName), true)); if (pFileName2 == NULL) return -1; - *static_cast(pFileName2) = L"file2.txt"; + *static_cast(pFileName2) = UTFstring{L"file2.txt"}; // Add a void element (data is discarded) EbmlVoid * pVoid = static_cast(pAttachment2->FindFirstElt(EBML_INFO(EbmlVoid), true)); if (pVoid == NULL) @@ -178,7 +178,7 @@ int main(void) if (EbmlId(*ElementLevel3) == EBML_ID(KaxFileName)) { KaxFileName & tmp = *static_cast(ElementLevel3); tmp.ReadData(aStream.I_O()); - printf("File Name = %ls\n", UTFstring(tmp).c_str()); + printf("File Name = %s\n", UTFstring(tmp).GetUTF8().c_str()); } else { ElementLevel3->SkipData(aStream, KaxAttached_Context); } diff --git a/test/mux/test6.cpp b/test/mux/test6.cpp index 415b057e..1732b697 100644 --- a/test/mux/test6.cpp +++ b/test/mux/test6.cpp @@ -84,8 +84,8 @@ int main(int argc, char **argv) KaxDuration & SegDuration = GetChild(MyInfos); *(static_cast(&SegDuration)) = 0.0; - *((EbmlUnicodeString *)&GetChild(MyInfos)) = L"libmatroska 0.5.0"; - *((EbmlUnicodeString *)&GetChild(MyInfos)) = L"����"; + *((EbmlUnicodeString *)&GetChild(MyInfos)) = UTFstring{L"libmatroska 0.5.0"}; + *((EbmlUnicodeString *)&GetChild(MyInfos)) = UTFstring{L"����"}; GetChild(MyInfos).SetDefaultSize(25); filepos_t InfoSize = MyInfos.Render(out_file); @@ -289,14 +289,14 @@ int main(int argc, char **argv) KaxChapterDisplay & aDisplay = GetChild(aAtom); KaxChapterString & aChapString = GetChild(aDisplay); - *static_cast(&aChapString) = L"Le film r�duit � un chapitre"; + *static_cast(&aChapString) = UTFstring{L"Le film r�duit � un chapitre"}; KaxChapterLanguage & aChapLang = GetChild(aDisplay); *static_cast(&aChapLang) = "fra"; KaxChapterDisplay & aDisplay2 = GetNextChild(aAtom, aDisplay); KaxChapterString & aChapString2 = GetChild(aDisplay2); - *static_cast(&aChapString2) = L"The movie in one chapter"; + *static_cast(&aChapString2) = UTFstring{L"The movie in one chapter"}; KaxChapterLanguage & aChapLang2 = GetChild(aDisplay2); *static_cast(&aChapLang2) = "eng"; @@ -318,10 +318,10 @@ int main(int argc, char **argv) *static_cast(&ChapterUID) = 0x67890; KaxTagName & aTagName = GetChild(TagSimple); - *static_cast(&aTagName) = L"NAME"; + *static_cast(&aTagName) = UTFstring{L"NAME"}; KaxTagString & aTagtring = GetChild(TagSimple); - *static_cast(&aTagtring) = L"Test�123"; + *static_cast(&aTagtring) = UTFstring{L"Test�123"}; filepos_t TagsSize = AllTags.Render(out_file, bWriteDefaultValues); MetaSeek.IndexThis(AllTags, FileSegment); diff --git a/test/mux/test8.cpp b/test/mux/test8.cpp index 80acd780..4cabe45b 100644 --- a/test/mux/test8.cpp +++ b/test/mux/test8.cpp @@ -238,19 +238,11 @@ int main(int argc, char **argv) } else if (EbmlId(*ElementLevel2) == EBML_ID(KaxMuxingApp)) { KaxMuxingApp *pApp = static_cast(ElementLevel2); pApp->ReadData(aStream.I_O()); -#if !defined(__CYGWIN__) && !defined(__APPLE__) && !defined(__BEOS__) && !defined(__NetBSD__) - wprintf(L"Muxing App : %ls\n", UTFstring(*pApp).c_str()); -#else - printf("Muxing App : %ls\n", UTFstring(*pApp).c_str()); -#endif + printf("Muxing App : %s\n", UTFstring(*pApp).GetUTF8().c_str()); } else if (EbmlId(*ElementLevel2) == EBML_ID(KaxWritingApp)) { KaxWritingApp *pApp = static_cast(ElementLevel2); pApp->ReadData(aStream.I_O()); -#if !defined(__CYGWIN__) && !defined(__APPLE__) && !defined(__BEOS__) && !defined(__NetBSD__) - wprintf(L"Writing App : %ls (����)\n", UTFstring(*pApp).c_str()); -#else - printf("Writing App : %ls (����)\n", UTFstring(*pApp).c_str()); -#endif + printf("Writing App : %s (����)\n", UTFstring(*pApp).GetUTF8().c_str()); } if (UpperElementLevel > 0) { @@ -561,11 +553,7 @@ int main(int argc, char **argv) unsigned int Index4; for (Index4 = 0; Index4(aDisplay[Index4])).c_str() ); -#else - printf(" Display \"%ls\"\n", UTFstring(*static_cast(aDisplay[Index4])).c_str() ); -#endif + printf(" Display \"%s\"\n", UTFstring(*static_cast(aDisplay[Index4])).GetUTF8().c_str() ); } else if (EbmlId(*(aDisplay[Index4])) == EBML_ID(KaxChapterLanguage)) { printf(" For language \"%s\"\n", std::string(*static_cast(aDisplay[Index4])).c_str() ); } else if (EbmlId(*(aDisplay[Index4])) == EBML_ID(KaxChapterCountry)) { diff --git a/test/tags/test9.cpp b/test/tags/test9.cpp index 8ac7f059..130d05eb 100644 --- a/test/tags/test9.cpp +++ b/test/tags/test9.cpp @@ -64,25 +64,25 @@ int main() { KaxTagSimple &stag_l1 = GetChild(tag); *(static_cast(&GetChild(stag_l1))) = - L"SIMPLE_TAG_NAME_LEVEL1_1"; + UTFstring{L"SIMPLE_TAG_NAME_LEVEL1_1"}; *(static_cast(&GetChild(stag_l1))) = - L"SIMPLE_TAG_STRING_LEVEL1_1"; + UTFstring{L"SIMPLE_TAG_STRING_LEVEL1_1"}; KaxTagSimple &stag_l1_2 = GetNextChild(tag, stag_l1); *(static_cast(&GetChild(stag_l1_2))) = - L"SIMPLE_TAG_NAME_LEVEL1_2"; + UTFstring{L"SIMPLE_TAG_NAME_LEVEL1_2"}; KaxTagBinary &tbin = GetChild(stag_l1_2); tbin.CopyBuffer((binary *)"SIMPLE_TAG_BINARY_LEVEL1_2", strlen("SIMPLE_TAG_BINARY_LEVEL1_2")); KaxTagSimple &stag_l2 = GetChild(stag_l1); *(static_cast(&GetChild(stag_l2))) = - L"SIMPLE_TAG_NAME_LEVEL2"; + UTFstring{L"SIMPLE_TAG_NAME_LEVEL2"}; *(static_cast(&GetChild(stag_l2))) = - L"SIMPLE_TAG_STRING_LEVEL2"; + UTFstring{L"SIMPLE_TAG_STRING_LEVEL2"}; KaxTagSimple &stag_l3 = GetChild(stag_l2); *(static_cast(&GetChild(stag_l3))) = - L"SIMPLE_TAG_NAME_LEVEL3"; + UTFstring{L"SIMPLE_TAG_NAME_LEVEL3"}; *(static_cast(&GetChild(stag_l3))) = - L"SIMPLE_TAG_STRING_LEVEL3"; + UTFstring{L"SIMPLE_TAG_STRING_LEVEL3"}; tags.Render(out);