I need to convert `TypedArray` with UTF-8 bytes to...
# javascript
a
I need to convert
TypedArray
with UTF-8 bytes to
String
, and JS solution is
decodeURIComponent(escape(String.fromCharCode.apply(null, typedArray)))
(or not-so-supported
new TextDecoder().decode(typedArray)
)
b
aimozg:
fun Int16Array.toString() = js("String").fromCharCode.apply(null, this)