From 01963f35451b4413d845d6ad4cf387c13c456c57 Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 31 Dec 2019 17:52:23 +0800 Subject: [PATCH] Introduce `val CharsetGBK` --- .../kotlin/net/mamoe/mirai/qqandroid/network/io/JceOutput.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/io/JceOutput.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/io/JceOutput.kt index a4445594b..f8c633353 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/io/JceOutput.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/io/JceOutput.kt @@ -4,6 +4,8 @@ import kotlinx.io.charsets.Charset import kotlinx.io.core.* import kotlin.reflect.KClass +private val CharsetGBK = Charset.forName("GBK") + /** * * From: com.qq.taf.jce.JceOutputStream @@ -11,7 +13,7 @@ import kotlin.reflect.KClass @Suppress("unused", "MemberVisibilityCanBePrivate") @UseExperimental(ExperimentalIoApi::class) class JceOutput( - private val stringCharset: Charset = Charset.forName("GBK"), + private val stringCharset: Charset = CharsetGBK, private val output: Output = BytePacketBuilder() ) {