diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a2755c995..dbd0776badb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Fixes * Fixed an issue where `LiveMessage` would not filter its event flow. #70 +* Fixed an issue where emojis from events would be decoded incorrectly. # 0.6.4 diff --git a/gateway/src/main/kotlin/com/gitlab/kordlib/gateway/DefaultGateway.kt b/gateway/src/main/kotlin/com/gitlab/kordlib/gateway/DefaultGateway.kt index e6d828e72e6..5f3f958a18b 100644 --- a/gateway/src/main/kotlin/com/gitlab/kordlib/gateway/DefaultGateway.kt +++ b/gateway/src/main/kotlin/com/gitlab/kordlib/gateway/DefaultGateway.kt @@ -182,14 +182,14 @@ class DefaultGateway(private val data: DefaultGatewayData) : Gateway { } return outputStream.use { - outputStream.toString(Charset.defaultCharset().name()) + outputStream.toString(Charsets.UTF_8) } } private suspend fun read(frame: Frame) { val json = when { compression -> frame.deflateData() - else -> frame.data.toString(Charset.defaultCharset()) + else -> String(frame.data, Charsets.UTF_8) } try {