utf8Size

fun String.utf8Size(throwOnMalformed: Boolean): Int

Returns the number of Bytes required to encode a String using UTF-8.

Return

the number of Bytes required to encode the String using UTF-8.

Parameters

throwOnMalformed

if true, throws a KalugaCharacterCodingException if the string contains malformed UTF-8.

Throws

if the string contains malformed UTF-8


Returns the number of Bytes required to encode a String using UTF-8.