- 증상
import json
dict = {'key' : '한글'}
print (json.dumps(dict))
# {'key' : '\ud55c\uae00'}
- 해결
# json. dumps 옵션으로 'ensure_ascii=False' 추가
import json
dict = {'key' : '한글'}
print (json.dumps(dict, ensure_ascii=False))
# {'key' : '한글'}
'프로그래밍 관련 > [Python] 간단 해결' 카테고리의 다른 글
[Python] UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 17533: illegal multibyte sequence (0) | 2020.05.21 |
---|---|
[Python] cv2.imread 한글 경로 인식 문제 (0) | 2020.05.21 |
[Python] OSError: mysql_config not found (Ubuntu 16.04) (0) | 2020.04.20 |
[CUDA] Windows10에서 간단하게 CUDA 사용률 확인하는 방법 (0) | 2020.02.14 |
[Python] Tensorflow 실행 시 CUBLAS_STATUS_ALLOC_FAILED 등의 그래픽카드 메모리 문제 해결 (0) | 2020.02.13 |