Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 731

Previous Page 730   Index   Next Page 732

Function Reference
Page 731 of 750
The return value is a pointer to the original conversion buffer; it must not be freed or changed. The
function can be called multiple times without causing a memory leak. However, if the conversion
buffer is no longer needed it can be released with the function FreeUniBuf(). The buffer is
automatically released when CloseFile() or FreePDF() is called.
The function requires no open PDF file; it can be used at any time. Invalid character sequences are
skipped by the algorithm, they do not break conversion.
Return values:
If the function succeeds the return value is a pointer to the converted UTF-32 Unicode string. If the
function fails the return value is NULL. The only possible error during conversion is out of memory.
UTF16ToUTF32Ex
UI32* pdfUTF16ToUTF32Ex(
const PPDF* IPDF,
// Instance pointer
const UI16* Source, // UTF-16 Unicode string
UI32 ADDR Len)
// String length in characters
The function converts a UTF-16 Unicode string to UTF-32. UTF-32 is the default Unicode format on
Linux and UNIX operating systems. The input string must be defined in the CPU's byte ordering
(little-endian on a little-endian machine and big-endian on a big-endian machine), the output string
is also returned in the CPU's byte ordering.
The used conversion algorithm is binary save. The parameter Len holds the string length in
characters before and after conversion. The new string length is normally not longer then original
one, but it is possible that the new string length will be shorter because surrogates are expressed as
two character sequence in UTF-16, but as one character in UTF-32.
The return value is a pointer to the original conversion buffer; it must not be freed or changed. The
function can be called multiple times without causing a memory leak. However, if the conversion
buffer is no longer needed it can be released with the function FreeUniBuf(). The buffer is
automatically released when CloseFile() or FreePDF() is called.
The function requires no open PDF file; it can be used at any time. Invalid character sequences are
skipped by the algorithm, they do not break conversion.
Return values:
If the function succeeds the return value is a pointer to the converted UTF-32 Unicode string. If the
function fails the return value is NULL. The only possible error during conversion is out of memory.
 

Previous topic: UTF16ToUTF32

Next topic: UTF32ToUTF16