Fix historical recent messages not decoding properly
For non-ASCII characters, we need to explicitly decode with utf8. Fixes Chat history encoding issue #396
This commit is contained in:
parent
3a4cd449f7
commit
1938fb910d
1 changed files with 4 additions and 1 deletions
|
|
@ -549,8 +549,11 @@ class TwitchApi {
|
|||
);
|
||||
|
||||
final response = await _client.get(url);
|
||||
|
||||
final decodedBody = utf8.decode(response.bodyBytes);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return jsonDecode(response.body)['messages'] as List;
|
||||
return jsonDecode(decodedBody)['messages'] as List;
|
||||
} else {
|
||||
return Future.error('Failed to get recent messages for $userLogin');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue