ConvertUTF16toUTF8 (FUN)

FUNCTION ConvertUTF16toUTF8 : UDINT

This function converts an UTF-16 string to an UTF-8 string (may be wrong for 3 or 4 character encoded UTF8 characters).

InOut:

Scope

Name

Type

Comment

Return

ConvertUTF16toUTF8

UDINT

Input

sourceStart

POINTER TO WORD

Pointer to the UTF-16 string to convert

targetStart

POINTER TO BYTE

Pointer to the UTF-8 string the converted string shall be stored to

dwTargetBufferSize

DWORD

The size (in bytes) of the buffer (targetStart) the result shall be stored in

bStrictConversion

BOOL

Do not continue on illegal characters