copySomeEncoded

Copies as much text from the beginning of source to buff as latter can hold performing conversion to different unicode transformation format if needed.

source will be set to its uncopied slice.

@safe @trusted pure
To[]
copySomeEncoded
(
To
From
)
(
ref inout(From)[] source
,
To[] buff
)
if (
isSomeChar!To &&
isSomeChar!From
)

Return Value

Type: To[]

Slice of the provided buffer buff with a (parital) copy of source.

Examples

import std.array: empty;

const(char)[] buff = ...;
wchar[n] wbuff = void;
while(!buff.empty)
	f(buff.copySomeEncoded(wbuff)); // `f` accepts at most `n` wide characters

Meta