kusal Posted January 29, 2008 Share Posted January 29, 2008 Hi, This is a really strange problem <?php // Set the content-type header("Content-type: image/png"); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw É´ $text = 'É´'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> When "É´" these two are together, server could not recognized it, so it displays a BOX character in the image. Can anyone help me. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/ Share on other sites More sharing options...
kusal Posted January 30, 2008 Author Share Posted January 30, 2008 Please someone can help me Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453052 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 That is a weird bug. I would open a ticket with PHP.net Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453057 Share on other sites More sharing options...
valtido Posted January 30, 2008 Share Posted January 30, 2008 try this $text = 'É'.'´'; Or $text = 'É\´'; PS Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453094 Share on other sites More sharing options...
tippy_102 Posted January 30, 2008 Share Posted January 30, 2008 Try adding: $text = utf8_encode($text); after the $text= line Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453107 Share on other sites More sharing options...
kusal Posted January 30, 2008 Author Share Posted January 30, 2008 Thank you tippy_102, it works. but my problem is a bug in PHP I guess Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453160 Share on other sites More sharing options...
kusal Posted January 30, 2008 Author Share Posted January 30, 2008 I have a problem again Image does not show correct charater for ’ - right single qoute Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453210 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 What does the code look like? The following worked for me: $text = utf8_encode("É´'"); Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453278 Share on other sites More sharing options...
kusal Posted January 30, 2008 Author Share Posted January 30, 2008 No no, not single quote. I'm talking about right single quote $text = utf8_encode("’"); Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-453471 Share on other sites More sharing options...
kusal Posted January 31, 2008 Author Share Posted January 31, 2008 Anyone please help with the right single quote Quote Link to comment https://forums.phpfreaks.com/topic/88423-a-strange-problem/#findComment-454407 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.