본문으로 바로가기

utf-8로 작성된 웹페이지가 특정 컴퓨터에서 한글이 깨질 때

웹페이지를 만들면서 주변 지인들의 컴퓨터에서는 별 이상없이 한글이 출력되었는데 어느 도서관에 들를 일이 있어 무심코 접속을 해 보다 깜짝 놀라고 말았습니다.



위 화면처럼 한글이 모두 꺠진 것입니다.
여러 컴퓨터에서 테스트 하지 못한 잘못입니다.

html의 개략적인 소스는 아래와 같습니다.

=====================================================
< html>
< head>
< title>타이틀< /title>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
< meta http-equiv="description" name="description" content="테스트용" />
< meta http-equiv="Keywords" name="Keywords" content="테스트용" />
< META http-equiv="imagetoolbar" content="no" />
< meta http-equiv-"X-UA-Compatible" content="IE=edge"/>
< link rel=stylesheet type="text/css" href="/cssnjs/real.css" />

< script LANGUAGE="JavaScript">
< /script>
< body>
본문
< body>
< /html>
=====================================================
구글링을 통해 알아 낸 해결책은 HTML파일 상단 부분에
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
를 추가하는 것입니다.

전체적인 소스는
======================================================
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
< head>
< title>타이틀< /title>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
< meta http-equiv="description" name="description" content="테스트용" />
< meta http-equiv="Keywords" name="Keywords" content="테스트용" />
< META http-equiv="imagetoolbar" content="no" />
< meta http-equiv-"X-UA-Compatible" content="IE=edge"/>
< link rel=stylesheet type="text/css" href="/cssnjs/real.css" />

< script LANGUAGE="JavaScript">
< /script>
< body>
본문
< body>
< /html>
======================================================



위 사진은 해결이 되고 난 다음 정상적으로 한글이 출력되는 모양을 짝은 것입니다.