php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31079 charset of imagestring
Submitted: 2004-12-14 03:28 UTC Modified: 2004-12-14 09:10 UTC
From: roberto at spadim dot com dot br Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.0.2 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: roberto at spadim dot com dot br
New email:
PHP Version: OS:

 

 [2004-12-14 03:28 UTC] roberto at spadim dot com dot br
Description:
------------
when using default charset
CP850 on my system
some characters "?" isn't printed with imagestring() function

how to show the default charset used by gd????
this can make my bug no more a bug
with a workaround i could change imagestring to image_string and make the correct charset 
thanks

Reproduce code:
---------------
<?
function image_cp_text($string){
	$default=iconv_get_encoding('internal_encoding');
//CP850
//	$str=$string;
	$str=iconv($default,"CP850",$string);
	return($str);
}
$im = imagecreate(100, 30);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
imagestring($im, 5, 0, 0, image_cp_text("?"), $textcolor);
header("Content-type: image/jpeg");
imagejpeg($im);
?>

Expected result:
----------------
image with all characters (?)

Actual result:
--------------
none blank image

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-14 09:10 UTC] derick@php.net
GD's internal fonts only support ISO-8859-2, this is not a bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 20:01:36 2025 UTC