Since all platforms does not guarantee that String always uses UTF-8 encoding, you can use this crossplatform API to perform operations on such strings.


new (?size:Int)

Allocate a new Utf8 buffer using an optional bytes size.


addChar (c:Int):Void

Add the given UTF8 character code to the buffer.

toString ():String

Returns the buffer converted to a String;

Static methods

staticiter (s:String, chars:Int ‑> Void):Void

Call the chars function for each UTF8 char of the string.

staticlength (s:String):Int

Returns the number of UTF8 chars of the String.