encoding(3)
- 
                
                  
                  Pandas 엑셀 다운 시 인코딩 깨짐(utf-8, utf-8-sig)에러 상황 엑셀 파일 생성 후 다운로드 시 한글이 깨지는 현상 발생(utf-8 형식은 동일) BOM(Byte Order Mark) 문제 https://stackoverflow.com/questions/17879198/adding-utf-8-bom-to-string-blob 해결 방법 utf-8-sig을 사용하여 encoding df.to_excel(file_path, index=False, columns=columns, header=headers, encoding='utf-8-sig') sig(signature)으로 인해 UTF-8 파일을 읽을때 BOM을 따로 처리하고 텍스트 내용과 분리하여 처리된다. 참고 https://stackoverflow.com/questions/57152985/what-is-t.. 2022.11.30
- 
                
                  
                  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 15: invalid start byte에러 상황 pandas 로 csv 생성 후 다운로드 시 UnicodeDecodeError 발생 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 15: invalid start byte 해결방법 Open 시 encoding 지정 file = open(path, 'rb', encoding='UTF8') 2022.11.30
- 
                
                  
                  LookupError: unknown encoding: x-windows-949ErrorFatal Python error: init_stdio_encoding: failed to get the Python codec name of the stdio encodingPython runtime state: core initializedLookupError: unknown encoding: x-windows-949윈도우가 기본으로 949로 셋팅되어 있어서 생기는 이슈 Trouble ShootingFile > Settings > File Encodings > Project Encoding > UTF-8 위의 방법으로 해결 안될 시 확인사항가상환경 확인python 가상환경이 로컬로 되어있을 수 있음. debug 시 script path 확인 2022.11.28