Skip to content

Commit

Permalink
Change default gateway charset to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
BartArys committed Sep 26, 2020
1 parent 6fa2b22 commit 145093e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 145093e

Please sign in to comment.