summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_filespec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_filespec.cpp')
-rw-r--r--core/fpdfdoc/cpdf_filespec.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp
index 2cc51e33d3..aa93b91a94 100644
--- a/core/fpdfdoc/cpdf_filespec.cpp
+++ b/core/fpdfdoc/cpdf_filespec.cpp
@@ -203,10 +203,9 @@ void CPDF_FileSpec::SetFileName(const WideString& wsFileName) {
WideString wsStr = EncodeFileName(wsFileName);
if (m_pObj->IsString()) {
- m_pWritableObj->SetString(ByteString::FromUnicode(wsStr));
+ m_pWritableObj->SetString(wsStr.ToDefANSI());
} else if (CPDF_Dictionary* pDict = m_pWritableObj->AsDictionary()) {
- pDict->SetNewFor<CPDF_String>(pdfium::stream::kF,
- ByteString::FromUnicode(wsStr), false);
+ pDict->SetNewFor<CPDF_String>(pdfium::stream::kF, wsStr.ToDefANSI(), false);
pDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsStr), false);
}
}