Library / System / Codecs / TextEncoding
CLASS
TextEncoding
Methods 4
METHOD appendUTF8(MUTABLE REFERENCE binary[] dst, REFERENCE String s, int64 off, int64 n) RETURNS voidreads
Append the UTF-8 of s's code points [off, off + n) to dst.
The window is bounds-checked; a String's code points are always
Unicode scalars, so this cannot fail.
METHOD stringFromCString(HANDLE s) RETURNS Stringreads
The String a C string's UTF-8 spells: a FOREIGN result, a main argument.
A null pointer is the empty String. Bytes that are not UTF-8 give the empty
String too, as the decoder reports them.
METHOD stringFromBytes(HANDLE p, int64 n) RETURNS Stringreads
The String of the n UTF-8 bytes at p, which is C memory the caller keeps.
METHOD utf8Of(REFERENCE String s) RETURNS char8[]reads
The UTF-8 of s. A String's code points are scalars, so this cannot fail.