테스트 사이트 - 개발 중인 베타 버전입니다

살려주세요... 게시글 엑셀 다운로드 할때 한글깨짐현상 채택완료

홈스킨 10년 전 조회 6,285

<?</p><p>header( "Content-type: application/vnd.ms-excel;charset=KSC5601");
header( "Content-Disposition: attachment; filename=list.xls" );
header( "Content-Description: PHP4 Generated Data" );

include "_common.php";</p><p>
if($_POST['chk_wr_id']) {
 $in = implode(", ", $_POST['chk_wr_id']);
 $where = "WHERE wr_id IN($in)";
}
?></p><p>
<html></p><p><body></p><p> <table border="1">
 <tr>
  <th>wr_id</th>
  <th>title</th>
 </tr>
<?</p><p>
$que = sql_query("SELECT * FROM g5_write_".$_POST['bo_table']." ".$where." ORDER BY wr_id DESC"); </p><p> </p><p>while($row = sql_fetch_array($que)) {
?>
 <tr>
  <td><?=$row['wr_id']?></td>
  <td><?=$row['wr_subject']?></td>
 </tr>
<?
}
?>
</table></p><p></body></p><p></html>​</p><p>

 

 

다운받을때 한글이 계속 깨져서 나옵니다.

아래처럼 하면 한글이 안깨지고 잘 나오는데요..

아무래도 DB에서 불러 올때 파일 캐릭터셋을 변환해줘야 하는데

어느 파일에서 어떤부분에 어떤 소스를 수정해야 할지 모르겠습니다.

 

UTF-8서버 사용중입니다.

도와주세요 ㅠㅠ

 

 

<?</p><p>header( "Content-type: application/vnd.ms-excel;charset=KSC5601");
header( "Content-Disposition: attachment; filename=list.xls" );
header( "Content-Description: PHP4 Generated Data" );
?></p><p>
<html></p><p><body></p><p> <table border="1">
 <tr>
  <td>한글이 안깨지고 잘 나와요</td>  
 </tr>
</table></p><p></body></p><p></html>​</p><p>

 

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

답변 2개

10년 전

ㅅㄷㄴㅅ

로그인 후 평가할 수 있습니다

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

10년 전

header( "Content-type: application/vnd.ms-excel;charset=KSC5601");

 

charset 값이 잘못되었네요. 아래와 같이 바꿔주세요.

header( "Content-type: application/vnd.ms-excel;charset=utf-8");

 

 

로그인 후 평가할 수 있습니다

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

답변을 작성하려면 로그인이 필요합니다.

로그인