commit baf872791246cd3b3fe9ca3da39082f2c72b047d parent fe95a1bcc64d27d3e7ebd8f55ad7778de77942ed Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:09:15 +0200 fix(util/proto_reader): toString ascii detection Diffstat:
M | common/src/main/kotlin/me/rhunk/snapenhance/common/util/protobuf/ProtoReader.kt | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/src/main/kotlin/me/rhunk/snapenhance/common/util/protobuf/ProtoReader.kt b/common/src/main/kotlin/me/rhunk/snapenhance/common/util/protobuf/ProtoReader.kt @@ -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 }