Why isn't it possible to pass a charset to `ByteAr...
# announcements
a
Why isn't it possible to pass a charset to
ByteArray.decodeToString
with kotlin 1.3.40?
s
If charsets are JVM-only, then that's probably why. The new functions in kotlin 1.3.40 are platform-agnostic
a
For JVM specifically I think this can lead to confusion as with encoding/decoding it will take the system default.
Naming it
ByteArray.decodeToUtf8String
is probably more clear for every platform
g
Than it will not allow to evolve this API in future
If one day common will have support of different encodings it will be just added as param with default UTF8 value
also many existing Kotlin API already use UTF8 as default
i
We plan to provide common
decodeToString
with
Charset
in kotlinx-io library