According to documentation, `kotlin-stdlib/kotlin....
# multiplatform
n
According to documentation,
kotlin-stdlib/kotlin.native/toUtf8
should be available on String in my multiplatform project. But I cannot invoke it. Intellisense doesn’t see that method. What am I doing wrong?
Okay, seems I get it. I can use
toUtf8
for
compileKotlinIos
task (native code), but not for JVM. So that’s where the code will have to get platform-specific.
d
If you are using kotlinx serialization, it has these that you can use
Copy code
expect fun String.toUtf8Bytes(): ByteArray
expect fun stringFromUtf8Bytes(bytes: ByteArray): String
n
Thank you Eric