Hacker News new | ask | show | jobs
by egnehots 846 days ago
it's based on the JVM which uses UTF-16 internally for strings
1 comments

Understandable, though JVM strings can also use the UTF-8 charset under the hood. In fact, if you initialize a Kotlin string from a byte array, it'll default to assuming the UTF-8 charset [0]. (Kotlin chars are still 16-bit code units though, and it is true that you can't use the native JVM char type if you do this. Personally I think that's still acceptable.)

[0] https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-st...