Platform Package reference: Function EwNewStringUtf8()

Description of the function EwNewStringUtf8() available in all Platform Packages for C compatible target systems. This function is intended to be used when integrating the Embedded Wizard created GUI application with the underlying graphics subsystem, graphics hardware or other external GUI applications coexisting on the same system.

Declaration

XString EwNewStringUtf8( const unsigned char* aUtf8, int aCount )

Parameters

aUtf8

Pointer to an UTF-8 coded string.

aCount

Number of bytes within the aUtf8 string without the zero terminator sign.

Discussion

The function EwNewStringUtf8() creates a wide-character (16-bit per character) copy of the given UTF-8 string aUtf8. The function reserves memory for the new string and decodes the input characters from aUtf8 string into this reserved memory area. During the operation the function decodes all UTF-8 characters to 16-bit wide-character properly.

Please note, the returned string is controlled by the Embedded Wizard Runtime Environment. If not used anymore, the string is released automatically during the next EwReclaimMemory() invocation. Please see Be careful when exchanging strings.