Decode json content as utf8
This commit is contained in:
parent
8ac60d46a8
commit
b0f0b0084e
@ -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}');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user