1

주제: [자체해결]검색 기능에 한글이 깨질 경우

최근에 euc_kr 서버에서 utf-8 웹 호스팅 서버로 갈아탔습니다.

DB 인코딩은 DB 백업한 걸 업로드 하면서 변경을 해서 별 문제가 없는데

검색할 때 글자가 깨져서 검색을 못 하더군요.

아마도 인코딩 문제라고 생각돼서 검색 부분 소스를 봤더니 인코딩 부분이 빠진 거 같아 나름대로

blog/interface/blog/search.php 파일에

----수정 전-------------------------------------------------------------------------------------------------

$search = isset($_GET['search']) ? $_GET['search'] : $suri['value'];
$search = isset($_GET['q']) ? $_GET['q'] : $search; // Consider the common search query GET name. (for compatibility)

$list = array('title' => '', 'items' => array(), 'count' => 0);
----------------------------------------------------------------------------------------------------------

----수정 후-------------------------------------------------------------------------------------------------

$search = isset($_GET['search']) ? $_GET['search'] : $suri['value'];
$search = isset($_GET['q']) ? $_GET['q'] : $search; // Consider the common search query GET name. (for compatibility)

# UTF-8 Encoding
$search = iconv("EUC-KR","UTF-8", $search);
$list = array('title' => '', 'items' => array(), 'count' => 0);
------------------------------------------------------------------------------------------------------------

이렇게 수정하니 검색도 이제 잘 되네요.

제 홈페이지에는 맞게 된 거 같은데 다른 분들은 어떨지.. 참고하세요.

2

답글: [자체해결]검색 기능에 한글이 깨질 경우

일반적인 한글 검색이 안되는 경우, 아래의 문서로도 작업이 가능합니다.
http://forum.tattersite.com/ko/viewtopic.php?id=5333

텍스트큐브를 이용하시다 불편하신 점 있으시면 아래로 연락주세요.
Needlworks/TNF - LonnieNa
nateon : y12x2 (a.t) nate.com / mail : lonniena (a.t) needlworks.org
http://twitter.com/@textcube

3

답글: [자체해결]검색 기능에 한글이 깨질 경우

더 간단한 방법이 있었군요. ^^

감사감사.