W3cubDocs

/Kotlin

toUtf8

Platform and version requirements: Native (1.3)
fun String.toUtf8(): ByteArray
Deprecated: Use encodeToByteArray instead
fun String.toUtf8(
    start: Int = 0, 
    size: Int = this.length
): ByteArray
Deprecated: Use encodeToByteArray instead

Converts a String into an UTF-8 array. Replaces invalid input sequences with a default character.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/to-utf8.html