From baf872791246cd3b3fe9ca3da39082f2c72b047d Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:09:15 +0200 Subject: [PATCH] fix(util/proto_reader): toString ascii detection --- .../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 index 5d84550c..bb5b33ae 100644 --- 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 }