Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Python
- softeer
- 코틀린
- 자바
- 안드로이드
- DART
- 스위프트
- 프로그래머스
- 아마존 웹 서비스
- 소프티어
- java
- 파이썬
- 알고리즘
- 개발
- baekjoon
- 머신러닝
- 백준
- MVVM
- kotlin
- 현대sw
- GDSC
- aws
- VSCode
- 코테
- Android
- SWIFT
- 플러터
- programers
- 다트
- Flutter
Archives
- Today
- Total
조준장 개발자 생존기
[Flutter - Error] Unhandled Exception: type 'String' is not a subtype of type 'List<dynamic>' in type cast => JSON 파싱 중 한글 깨짐 본문
Develop/Flutter
[Flutter - Error] Unhandled Exception: type 'String' is not a subtype of type 'List<dynamic>' in type cast => JSON 파싱 중 한글 깨짐
JunJangE 2022. 1. 1. 15:16json 파싱 중 한글이 깨지는 상황이 생길 수 있다.
var body = await json.decode(json.encode(response.body));
print(body);
위 코드를 사용해서 한글이 깨질 경우에는 다음 코드를 통해 해결하자.
var body = utf8.decode(response.bodyBytes);
print(body);
json 형식은 서버와 통신을 하려고 할 때 통상적으로 사용하는 형식이고 utf8 형식의 경우 문자 형식으로 공통으로 쓰기 좋아 통일할 때 사용하면 좋다. 상황에 맞춰 쓰면 될 것 같다.
'Develop > Flutter' 카테고리의 다른 글
[Flutter - Error] A package may not list itself as a dependency. (0) | 2022.01.06 |
---|---|
[Flutter] 플러터 Provider로 공공데이터 오픈 API 활용 (0) | 2022.01.05 |
[Flutter - Error] Unhandled Exception: FormatException: Unexpected character (at character 1) (0) | 2022.01.01 |
[Flutter] 플러터 MultiProvider를 통해 BottomNavigationBar 구현 (0) | 2021.12.30 |
[Flutter] 플러터 Bloc 패턴 구현 (0) | 2021.12.27 |