ConvertUTF8toUTF16 (FUN)

FUNCTION ConvertUTF8toUTF16 : UDINT

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

InOut:

Scope

Name

Type

Comment

Return

ConvertUTF8toUTF16

UDINT

Input

sourceStart

POINTER TO BYTE

Pointer to the UTF-8 string to convert

targetStart

POINTER TO WORD

Pointer to the WSTRING the result shall be stored in

dwTargetBufferSize

DWORD

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

bStrictConversion

BOOL

Do not continue on illegal characters