김장코딩

  • 홈
  • 태그
  • 방명록

Json 데이터 변환 오류 1

[Flutter] Json 데이터 받아올 시 DateFormat 불가 오류 해결

String 형태인 Json 데이터를 받아왔는데 분명 날짜와 시간이 정확한데 Invalid date format이라며 DateFormat이 불가했다. Invalid date format 20230308T093800 이런식으로 정확한데 변환이 되지 않았다. 혹시 뒤에 공백이 있나 싶어 Trim()과 substring 모두 사용해 봤지만 작동되지 않았다. 해당 Json 데이터를 자세하게 보기 위해 로그를 찍어봤더니 Time의 구조가 "100000\u0000\u0000\u0000\u0000"와 같이 나와있었다. 찾아보니 \u0000은 유니코드 공백, Null이라고 한다. json['time'].replaceAll('\u0000', '') 와 같이 \u0000을 replace하여 해결하였다.

Flutter 2023.03.08
이전
1
다음
더보기
프로필사진

김장코딩

  • 분류 전체보기 (17)
    • Flutter (11)
    • Java & Kotlin (1)

Tag

flutter, drag & drop 오류, 안드로이드 알림 개수 제한, gradle 오류, the improper use of a GetX has been detected, Json 데이터 변환 오류, libnative-lib.so not found, flutter window 빌드, ModalBottomSheet 오류, flutter window, Flutter Window build, libnative-lib.so is 64-bit instead of 32-bit, 안드로이드 알림 제한, 플러터 윈도우 빌드, Could not resolve all artifacts for configuration ':classpath'., GetX 에러, GetX, Invalid date format, auto grouping, android notification limit,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/06   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바