utf8Length

Calculates the number of UTF8 code points in a UTF8-encoded string. Calls the standard unicode error handler on error, which throws a new UnicodeException.

  1. size_t utf8Length(cstring str)
    size_t
    utf8Length
  2. size_t utf8Length(cstring str, void delegate(size_t) error_dg)

Parameters

str cstring

The string to calculate the length of.

Return Value

Type: size_t

The length of the given string.

Throws

UnicodeException if an invalid UTF8 code unit is detected.

Meta