diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_filespec.cpp | 5 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 4 |
2 files changed, 4 insertions, 5 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); } } diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index d7cee35704..26dfbc17f0 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -1030,8 +1030,8 @@ std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF( if (!pdf_path.IsEmpty()) { if (bSimpleFileSpec) { WideString wsFilePath = CPDF_FileSpec::EncodeFileName(pdf_path); - pMainDict->SetNewFor<CPDF_String>( - pdfium::stream::kF, ByteString::FromUnicode(wsFilePath), false); + pMainDict->SetNewFor<CPDF_String>(pdfium::stream::kF, + wsFilePath.ToDefANSI(), false); pMainDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsFilePath), false); } else { |