Decode json content as utf8

This commit is contained in:
Shawn 2023-10-11 13:56:51 -06:00
parent 8ac60d46a8
commit b0f0b0084e

View File

@ -94,7 +94,7 @@ class ServiceResult<R> {
ServiceResult(this.response, R Function(Map<String, dynamic>) parser) { ServiceResult(this.response, R Function(Map<String, dynamic>) parser) {
if (StringUtils.isNotEmpty(response.body) && response.success) { if (StringUtils.isNotEmpty(response.body) && response.success) {
try { try {
content = parser.call(jsonDecode(response.body!)); content = parser.call(jsonDecode(utf8.decode(response.raw!.bodyBytes)));
} on FormatException catch (e) { } on FormatException catch (e) {
dev.log('ParseError: ${e.message}'); dev.log('ParseError: ${e.message}');
} }