WideCharToMultiByte v0.1.0

Source
Converts UTF-16 text to a multibyte encoding.

Package: Windows

Microsoft documentation: WideCharToMultiByte

Signature

func WideCharToMultiByte(
    codePage: CodePage,
    flags: uint32,
    wideCharStr: *const char16,
    wideChar: int32,
    multiByteStr: *char8,
    multiByte: int32,
    defaultChar: *char8,
    usedDefaultChar: *bool32
) -> int32;

Parameters

NameDescription
codePageDestination encoding.
flagsConversion flags.
wideCharStrUTF-16 source.
wideCharCode-unit count, or -1 to include a terminator.
multiByteStrByte destination, or null for a size query.
multiByteDestination capacity in bytes.
defaultCharSubstitution byte, or null.
usedDefaultCharReceives whether substitution occurred, or null.

Returns

int32 — bytes written or required, or 0 on failure. For a size query, pass null and 0 as the destination. For UTF-8, pass null for both substitution parameters.

See also