March 28, 2024

Dynamic Windows Function [dw_wchar_to_utf8]

Syntax

char * dw_wchar_to_utf8(wchar_t * wstring)

Parameters

wchar_t * wstring: Wide source string.

Returns

char * UTF-8 encoded string that needs to be freed with dw_free() or NULL on failure.

Description

Converts a wide string into a UTF-8 encoded string.

Remarks

Please note wchar_t may be 2 or 4 bytes depending on the platform. OS/2 and Windows are typically 2 bytes, Mac and Unix are typically 4 bytes.

This API was introduced in version 2.4.