fix(util/proto_reader): toString ascii detection

This commit is contained in:
rhunk 2023-10-14 12:09:15 +02:00
parent fe95a1bcc6
commit baf8727912

View File

@ -217,7 +217,7 @@ class ProtoReader(private val buffer: ByteArray) {
return@runCatching
}
//auto detect ascii strings
if (array.all { it in 0x20..0x7E }) {
if (array.all { it in (0x20..0x7E) || it == 0x0A.toByte() || it == 0x0D.toByte() }) {
stringBuilder.append("string: ${array.toString(Charsets.UTF_8)}\n")
return@runCatching
}