cp949' codec can't decode byte 0xec in position 84: illegal multibyte sequence 오류 해결 json파일 가져올때
2021. 6. 30. 17:35ㆍPython
json파일을 가져오는 중에 cp949' codec can't decode byte 0xec in position 84: illegal multibyte sequence 이란 오류가 발생했다
open('./도서.json') as file:
realData = json.load(file)
# 'rt', encoding='UTF8'를 추가해서 실행하면 된다.
open('./도서.json', 'rt', encoding='UTF8') as file:
realData = json.load(file)
cp949 코덱으로 인코딩 된 파일을 읽을때 문제가 생긴다고 한다.
728x90
반응형
'Python' 카테고리의 다른 글
Python @classmethod, @staticmethod 차이점 (0) | 2021.07.10 |
---|---|
python 해당 값 찾기 in 연산자 (0) | 2021.07.09 |
string 자료형 문장부호 없애는 방법 string.puctuation (0) | 2021.07.09 |
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 14: invalid continuation byte 해결 방법 (0) | 2021.05.14 |
SyntaxError: Non-ASCII character 에러 해결 (0) | 2021.05.14 |