did you try Valgrind on your program? It it very helpful tool for problems like this one.
u
uli
11/28/2017, 7:55 PM
Might it be, because you try to decode encrypted (read: random) data as UTF8? Do you still get that core dump if you comment out
var contentAsString = kotlin.text.fromUtf8Array(contents!!, 0, contents!!.size)
➕ 1
o
olonho
11/29/2017, 5:52 AM
This makes sense, actually. Data in strings are intended to be valid utf8, and if they are not - exception shall be thrown (it’s a bug that it didn’t, although). But why you need to keep binary data in string? ByteArray is intended for that purpose.
yes, it was related to decoding of incorrect UTF-8 character sequences