Comment #2 on issue 682 by
jr.ta...@gmail.com: FPDF_LoadDocument unable to load file whose name has multibyte characters
https://bugs.chromium.org/p/pdfium/issues/detail?id=682#c2Hi dsinclair,
By passed through the system you mean as it's passed from Java through JNA to the DLL or as it's processed inside the DLL itself?
I checked the source:
DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
FPDF_BYTESTRING password) {
// NOTE: the creation of the file needs to be by the embedder on the
// other side of this API.
CFX_RetainPtr<IFX_SeekableReadStream> pFileAccess =
IFX_SeekableReadStream::CreateFromFilename((const char*)file_path);
if (!pFileAccess)
return nullptr;
auto pParser = pdfium::MakeUnique<CPDF_Parser>();
pParser->SetPassword(password);
auto pDocument = pdfium::MakeUnique<CPDF_Document>(std::move(pParser));
CPDF_Parser::Error error =
pDocument->GetParser()->StartParse(pFileAccess, pDocument.get());
if (error != CPDF_Parser::SUCCESS) {
ProcessParseError(error);
return nullptr;
}
return FPDFDocumentFromCPDFDocument(pDocument.release());
}
Does the cast to (const char*) make reading the string passed done byte-by-byte? Specifically, are multibyte parts of the string being read per byte when cast to const char*?