UTF8

[Django] csv.writer 한글 입력 response.write(u'\ufeff'.encode('utf8')) 를 추가해 주면 된다. def view(request): response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="somefilename.csv"' response.write(u'\ufeff'.encode('utf8')) writer = csv.writer(response) writer.writerow(['1 row', 'A', 'B', 'C']) writer.writerow(['2 row', 'A', 'B', 'C']) return response [출처..
[Django] django_mysql Warnings 해결 방법 1. MySQL Strict Mode is not set for database connection 'default' WARNINGS: ?: (django_mysql.W001) MySQL Strict Mode is not set for database connection 'default' HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you a..
· 기타
[VSCode] Python 실행 시 terminal에서 한글 깨짐 발생 > .vscode/tasks.json 수정 - tasks.json 파일 여는 법 : ctrl + shift + p 누른 후 "Tasks: Configure Tasks" 선택 - python3이면 command에 python3로 입력하면 된다. { "version": "0.1.0", "command": "python", "isShellCommand": true, "args": ["${file}"], "showOutput": "always", "options": { "env": { "PYTHONIOENCODING": "UTF-8" } } } + 추가 인코딩을 utf8이 아닌 EUC-KR로 변경하면 된다. 위에는 utf8으로 아래는 eu..
[Python][MySQL] Warning: Incorrect string value 에러 해결 방법 project.py:83: Warning: Incorrect string value: '\xED\x94\x84\xEB\xA1\x9C...' for column 'name' at row 11584 cur.execute(query) Python 에서 MySQL에 데이터를 Insert 하는데, 한글을 입력하려는 경우 위와 같은 경고가 뜨며, Insert 된 값은 ??? 로 된다면, Insert 하려는 테이블의 CHARSET 값을 확인 한 후 UTF8이 아니면 UTF8로 변경해 주면된다. ALTER TABLE 테이블명 CONVERT TO CHARACTER SET utf8;
· WEB/HTML
[HTML] 한글 깨짐 해결 방법 태그 안에 추가하면 된다. [참고] HTML인코딩
[Python] ANCI to UTF8 encoding을 mbcs로 하면 된다! import codecs codecs.open("ANSI_file.txt","r",encoding="mbcs") 참고 : stackoverflow
S0PH1A
'UTF8' 태그의 글 목록