첨

iconv("euc-kr","utf-8","$connect"); 한번에 모든 언어셋 변경

extend/iconv.php

<?
echo getcwd()."<br>";
chdir('./gnuboard4');

echo getcwd()."<br>";
$dir="../gnuboard4";
euc2utf8($dir);
function euc2utf8($dir)
{
if(is_dir($dir))
 {
  if($dh=opendir($dir))
    {
      while(($file=readdir($dh)) !== false)
        {
if($file!="."&&$file!="..")
  {
      if(strcmp(strrchr($file,"."),".php")==0 or strcmp(strrchr($file,"."),".sql")==0)//php와sql가 들어간 파일을 찾는다.
{
$str=fopen("$dir/$file","r");//파일 읽어오기
$connect=fread($str,filesize("$dir/$file"));
fclose($str);//파일닫기
$connect=iconv("euc-kr","utf-8","$connect");//iconv함수로 문자열을 변환
$target=fopen("$dir/$file","w");
fwrite($target,$connect);
fclose($target);//파일닫기
echo $file."<br>";//파일명리스트 출력

}
euc2utf8("$dir/$file");

}

          }
  closedir($dh);//디렉토리 닫기
  }
 }
}
?>

댓글 1개

이거 문자열로 변환해 주는게 아니고... 그냥 잘못하면 다 날라가 버립니다.

utf-8에서 한 게시판에 문제가 있어서 한번 돌렸더니만 ....

<?
// 만 달랑 남기고 다 날라가 버립니다...

ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
10-01-26 조회 5,170
10-01-21 조회 5,978
10-01-20 조회 6,753
10-01-20 조회 4,776
10-01-18 조회 9,229
10-01-18 조회 5,283
10-01-18 조회 4,977
10-01-16 조회 3,706
10-01-15 조회 6,413
10-01-12 조회 5,811
10-01-12 조회 7,627
10-01-10 조회 7,789
10-01-06 조회 5,569
10-01-06 조회 9,380
10-01-05 조회 4,017
10-01-05 조회 3,222
10-01-05 조회 4,407
10-01-04 조회 1.2만
10-01-04 조회 5,151
10-01-03 조회 3,643