2017년 5월 21일 일요일

jsp 페이지에서 인코딩 붙이는 예

* jsp 페이지 인코딩 붙이는 예

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page pageEncoding="euc-kr"%>
<%
request.setCharacterEncoding("EUC-KR");
%>



* 한글 처리의 종류

1) 응답시의 한글처리(클라이언트로 보낼때)
response.setContentType("text/html; charset=euc-kr");
response.setContentType("text/html; charset=KSC5601");
2) 요청시의 한글처리(클라이언트에서 브라우저로 볼때)
request.setCharacterEncoding("euc-kr");
request.setCharacterEncoding("KSC5601");