예전에 euc-kr을 사용하여 만든 홈페이지가 있었는데..

html내부에 매타 태그에 있는 iocharset을 바꾸어도.. 인코딩이 항상 UTF-8 고정 되어서 변경할 수 없었다.

원인이 뭔가 알아 봤더니..

아파치에 설정이 Default Charset이 지정되어 있었다..

/ect/httpd/conf/httpd.conf
파일은 열면 다음과 같은 부분을 찾을 수 있다.

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8


이 부분에서 AddDefaultCharset이 설정되어 있으면 HTML내부의 선택을 무시하고 항상 웹브라우져에서 항상 해당 인코딩으로 설정된다. 만약 페이지에 있는 메타 태그에 따라 인코딩 설정을 바꾸고 싶다면 위 한줄을 주석 처리 하면 된다.

+ Recent posts