UTF-8에서 GD 소스 한글이 꺠져요. 정보
UTF-8에서 GD 소스 한글이 꺠져요.본문
<?php
/***************************************************************
프로그램명 : Text를 GD 이미지로 뿌리기
작성자 : 윤영식
***************************************************************/
if (!$fontsize) { $fontsize=22; }
Header ("Content-type: image/png");
$bound = ImageTTFBBox($fontsize,0,"fonts/HYBDAM.TTF",stripslashes(iconv("EUC-KR","UTF-8",$text)));
$imgWidth = $bound[2]+2;
$imgHeight = $fontsize*1.5;
$im=ImageCreate($imgWidth,$imgHeight);
$white = ImageColorAllocate ($im, 255, 255, 255);
$green = ImageColorAllocate ($im, 0, 0, 0);
ImageTTFText($im,$fontsize,0,0,$imgHeight-5,$green,"fonts/HYBDAM.TTF",stripslashes(iconv("EUC-KR","UTF-8",$text)));
ImagePNG($im);
ImageDestroy($im);
?>
텍스트를 이미지로 변환하는 소스 인데,
utf-8 사용하고 있는데 영어는 나오는데 한글이 깨지네요. EUC-KR에서는 되는데..
왜이러죠..
/***************************************************************
프로그램명 : Text를 GD 이미지로 뿌리기
작성자 : 윤영식
***************************************************************/
if (!$fontsize) { $fontsize=22; }
Header ("Content-type: image/png");
$bound = ImageTTFBBox($fontsize,0,"fonts/HYBDAM.TTF",stripslashes(iconv("EUC-KR","UTF-8",$text)));
$imgWidth = $bound[2]+2;
$imgHeight = $fontsize*1.5;
$im=ImageCreate($imgWidth,$imgHeight);
$white = ImageColorAllocate ($im, 255, 255, 255);
$green = ImageColorAllocate ($im, 0, 0, 0);
ImageTTFText($im,$fontsize,0,0,$imgHeight-5,$green,"fonts/HYBDAM.TTF",stripslashes(iconv("EUC-KR","UTF-8",$text)));
ImagePNG($im);
ImageDestroy($im);
?>
텍스트를 이미지로 변환하는 소스 인데,
utf-8 사용하고 있는데 영어는 나오는데 한글이 깨지네요. EUC-KR에서는 되는데..
왜이러죠..
댓글 전체