PDFDoc doc(sFilePath) is fail

Hi,

 PDFDoc doc(sFilePath),    How sFilePath  support non ascii  file path?
My code:

            std::string  sNonASCIIFilePath;
            ......;

	std::wstring sNative;
	StringToWCHAR(sNative,sNonASCIIFilePath );
	UString sFilePath = sNative;
	PDFDoc doc(sFilePath);

doc create fail!

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

std::string  sNonASCIIFilePath;

What is this encoding?

StringToWCHAR(sNative,sNonASCIIFilePath );

I do not recognize this API. Do you mean this API?

There is a UString(std::wstring) API which takes in windows (UTF16-BE) unicode encoding.

For best cross platform code though I would recomend getting your string into UTF8 encoding and using this API.
https://www.pdftron.com/api/PDFTronSDK/cpp/classpdftron_1_1_u_string.html#a149883f0170576404954b67e43e51cab