toUTF32

Encodes the elements of s to UTF-32 and returns a newly GC allocated dstring of the elements.

dstring
toUTF32
(
S
)
(
scope S s
)

Parameters

s S

the range to encode

Return Value

Type: dstring

A UTF-32 string

Examples

import std.algorithm.comparison : equal;

// these graphemes are two code units in UTF-16 and one in UTF-32
assert("𤭢"w.length == 2);
assert("𐐷"w.length == 2);

assert("𤭢"w.toUTF32.equal([0x00024B62]));
assert("𐐷"w.toUTF32.equal([0x00010437]));

See Also

For a lazy, non-allocating version of these functions, see byUTF.

Meta