UTF-8 Conversion |
![]() |
|
|
|
|
|
Requires that STR_UNICODE is defined and STR_NO_RTLIBRARY is not defined
This method will convert the internal UCS-2 / UCS-4 representation of the string to the UTF-8 format.
The caller may use their own string buffer to place the result of the operation. In this case, buflen must contain the size of the caller's buffer, in bytes.
Alternatively, the values NULL and -1 can be passed as input parameters. In this case, Str Library will allocate dynamic memory to store the operation result.
The method returns the caller's buffer address (if one was provided), or the address of the dynamically allocated buffer. In the latter case, after the caller is done with the result, the memory should be freed by calling Str::OS_free()
|
|
|
|
|
Requires that STR_UNICODE is defined and STR_NO_RTLIBRARY is not defined
This method will read the UTF-8 string located at buffer of 'length' bytes and place the result in the Str object, destroying any previous object contents. If the length specified is -1, the buffer is expected to be null-terminated.
See also: Basic operations