Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

How are Unicode characters handled with the ActiveX, DLL and Delphi editions of the library?

Question

How are Unicode characters handled with the ActiveX, DLL and Delphi editions of the library?

Answer

There are many different ways to encode Unicode characters. One way is to use strings with 16-bit characters. COM/ActiveX uses 16-bit characters, so adding Unicode support for the ActiveX edition of the library was easy.

For the Delphi and DLL editions, the strings have always been 8-bit characters. Unfortunately we can't change the definition of functions as this would cause issues with backwards compatibility.

This means that when using the Delphi and DLL editions and working with Unicode characters, you need to encode your file names with UTF8 encoding, as mentioned in the function reference.

Different languages will have different functions to do the UTF8 encoding. For Delphi, the Utf8Encode function can be used, for example:

var
 FileNameW: WideString;
 FileNameA: AnsiString;
begin
 FileNameW := WideString('C:\unicode') + WideChar(20081) +
WideString('\test.pdf');
 FileNameA := Utf8Encode(FileNameW);
 QP.SaveToFile(FileNameA);
end;

That would save the file in the "C:\unicodeä¹±\test.pdf" folder.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum