In Kotlin Native how would I find the number of bytes in a utf-8 string?
Copy code
@Test
fun `The number of bytes in a euro is three`(){
//count and length return 1 but a euro symbol is a multibyte character
assertEquals(3, "€".count, "Wrong number of bytes for a Euro.")
}
s
serebit
11/19/2018, 4:04 AM
If you have access to kotlinx.serialization, you can use its