diff --git a/Tests/LibPDF/TestPDF.cpp b/Tests/LibPDF/TestPDF.cpp index 8d379c79b7e..da721d032ac 100644 --- a/Tests/LibPDF/TestPDF.cpp +++ b/Tests/LibPDF/TestPDF.cpp @@ -54,15 +54,12 @@ TEST_CASE(encodig) auto info_dict = MUST(document->info_dict()).value(); EXPECT_EQ(MUST(info_dict.author()).value(), "Nico Weber"); EXPECT_EQ(MUST(info_dict.producer()).value(), (char const*)u8"Manüally Created"); - - // FIXME: Make this pass. - // EXPECT_EQ(MUST(info_dict.title()).value(), (char const*)u8"Êñ©•ding test"); + EXPECT_EQ(MUST(info_dict.title()).value(), (char const*)u8"Êñ©•ding test"); auto outline_dict = document->outline(); EXPECT_EQ(outline_dict->count, 3u); EXPECT_EQ(outline_dict->children[0]->title, (char const*)u8"Titlè 1"); - // FIXME: Make this pass: - // EXPECT_EQ(outline_dict->children[1]->title, (char const*)u8"Titlè 2"); + EXPECT_EQ(outline_dict->children[1]->title, (char const*)u8"Titlè 2"); EXPECT_EQ(outline_dict->children[2]->title, (char const*)u8"Titlè 3"); } diff --git a/Userland/Libraries/LibPDF/Document.cpp b/Userland/Libraries/LibPDF/Document.cpp index fb63d20b488..995e8529bc4 100644 --- a/Userland/Libraries/LibPDF/Document.cpp +++ b/Userland/Libraries/LibPDF/Document.cpp @@ -92,9 +92,7 @@ DeprecatedString Document::text_string_to_utf8(DeprecatedString const& text_stri return text_string.substring(3); } - // FIXME: Convert from PDFDocEncoding to UTF-8. - - return text_string; + return TextCodec::decoder_for("PDFDocEncoding"sv)->to_utf8(text_string).release_value_but_fixme_should_propagate_errors().to_deprecated_string(); } PDFErrorOr> Document::create(ReadonlyBytes bytes)