Index: core/fpdfdoc/cpdf_annotlist.cpp |
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp |
index 631978175c5d8b5662fcc2fe7e1f96a89ce2b0fe..31c8542daaf34f8fc9639694f4be3572762a3616 100644 |
--- a/core/fpdfdoc/cpdf_annotlist.cpp |
+++ b/core/fpdfdoc/cpdf_annotlist.cpp |
@@ -24,7 +24,9 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot, |
if (!pParentDict) |
return std::unique_ptr<CPDF_Annot>(); |
- CFX_ByteString sContents = pParentDict->GetStringBy("Contents"); |
+ // TODO(jaepark): We shouldn't strip BOM for some strings and not for others. |
+ // See pdfium:593. |
+ CFX_WideString sContents = pParentDict->GetUnicodeTextBy("Contents"); |
if (sContents.IsEmpty()) |
return std::unique_ptr<CPDF_Annot>(); |
@@ -32,7 +34,7 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot, |
pAnnotDict->SetAtName("Type", "Annot"); |
pAnnotDict->SetAtName("Subtype", "Popup"); |
pAnnotDict->SetAtString("T", pParentDict->GetStringBy("T")); |
- pAnnotDict->SetAtString("Contents", sContents); |
+ pAnnotDict->SetAtString("Contents", sContents.UTF8Encode()); |
CFX_FloatRect rect = pParentDict->GetRectBy("Rect"); |
rect.Normalize(); |