asp를 사용하는데 한글이 자꾸 깨져서 구글링해서 해결했다.
일단 처음에 기본 코드만 있을 때는 아래와 같은 코드 세줄을 맨 위에 추가해주면 한글이 깨지지 않았다.
<%@Codepage = 65001 %>
<% Option explicit %>
<% Response.Codepage = 65001 %>
그런데 DB연결도 하고 나니까 저 코드가 있어도 문제가 해결이 안돼서 더 찾아봐서 해결했다.
다음과 같은 코드를 최상단에 추가해주면 DB연결했던 코드에서도 문제 해결 완료!
<%@Codepage = 65001 language="VBScript"%>
<%
' 한글깨짐 방지
response.charset="UTF-8"
session.codepage="65001"
response.codepage="65001"
Response.contentType="text/html;charset=UTF-8"
%>
참고: https://stackoverflow.com/questions/31524404/classic-asp-and-utf-8
Classic ASP and UTF-8
I'm changing my application to work with utf-8 pages. So every ASP page has this code Response.CodePage = 65001 Response.CharSet = "utf-8" And HTML <meta charset="UTF-8" /> <meta http-...
stackoverflow.com
'에러해결' 카테고리의 다른 글
[ubuntu] 우분투 xrdp 원격접속하면 검은화면만 뜨는 문제 (0) | 2022.11.22 |
---|---|
[ubuntu] userdel: user xx is currently used by ... 에러 (0) | 2022.11.22 |
vscode에서 .classpath파일 생성 안되는 에러 해결 (0) | 2022.04.17 |
maven 프로젝트에서 클래스파일 생성경로와 tomcat 클래스파일 읽는 경로 달라서 인식 못하는 문제 해결 (0) | 2022.03.20 |