티스토리 뷰

반응형

1. 제일 먼저 Database 환경을 확인해봐야 한다.

show variables like 'c%'

모든 character set이 동일해야 한다.

2. 1의 경우에 해당하지 않는 경우 jsp/java/html 페이지의 context type 과 charset / 문서타입을 일치 시킨다. 

(UTF-8 / EUC-KR)

contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%

meta http-equiv="Content-Language" content="ko"
meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

3. 모두 일치 시켰다면 post 한글 깨짐을 방지 하기 위해

request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");

을 request.getParameter("param") 위에 선언해주면 한글 깨짐을 방지할 수 있다.

4. get 방식은 무조건 server.xml 에서

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" />

굵은 부분 추가하고 서버 재시작.



출처: http://ifmkl.tistory.com/123 [꼬반]

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함