toString

Encode a string of characters into an UTF-8 string, providing one character at a time to the delegate.

This allow to shift the allocation strategy on the user, which might have more information about the kind of data passed to this function.

Parameters

input const(dchar)[]

UTF-8, UTF-16 or UTF-32 encoded string to encode to UTF-8

dg size_t delegate

Output delegate to pass the result to

Note: Unlike the other toString variant, UTF-16 -> UTF-8 doesn't support surrogate pairs and will call onUnicodeError.

Meta