https://kotlinlang.org logo
Title
s

Stefan Oltmann

05/16/2023, 9:45 AM
What is your multiplatform replacement for String.toByteArray() ? I want to target JVM, Android, macOS and iOS.
s

Stefan Oltmann

05/16/2023, 9:49 AM
Thank you, will take that 🙂
o

Oleg Yukhnevich

05/16/2023, 9:59 AM
There is also String.encodeToByteArray if charset is not needed
k

Kirill Zhukov

05/16/2023, 5:46 PM
also Okio has ByteString https://square.github.io/okio/
I think
encodeToByteArray
will use utf8 by default
s

Stefan Oltmann

05/16/2023, 6:33 PM
Yes, most do it and it’s a sensible default.