tal Posted August 22, 2009 Share Posted August 22, 2009 Hello peoplei am having a very specific problemi can not print in IE7/8 the letter "nun" (נ or נ) in Hebrew while using GD image functions (as described below)i can print all other 26 letters but not that one (it shows as a square)but i can print all 27 letters including "nun" when viewed in FireFoxso is this a bug or there is a solution for it ?i am working with:- windows XP- php-5.3.0-Win32-VC6-x86.msi- apache_2.2.11-win32-x86-openssl-0.9.8i.msii will thank any one helping Talthis is my page written in notepad and saved as UTF-8--------------------------------------------------------------<?php$text="נ"; //only the letter "nun"//$text="אבגדהוזחטיכלמ סעפצקרשתץךףםן";//the rest of the letters without "nun"?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <title>GD image in IE</title> </head> <body> <img src="image.php?text=<?php echo $text ?>" width="768" height="493" border=0 style="z-index:-1;"> </body></html>my image.php written in notepad and saved as ANSI------------------------------------------------------------<?php$path="path/to/a/picture.gif";$font_path="C:/WINDOWS/Fonts/david.ttf"; (david is a hebrew font it comes with the windows install cd) $text=$_GET['text'];$src=imagecreatefromgif($path);$size=getimagesize($path);$im=imagecreatetruecolor($size[0],$size[1]);imagecopy($im,$src,0,0,0,0,$size[0],$size[1]);$color=imagecolorallocatealpha($im,0,0,0,0);imagettftext($im,12,0,50,50,$color,$font_path,$text);header('Content-type: image/gif');imagegif($im);imagedestroy($im);imagedestroy($src);?> Link to comment Share on other sites More sharing options...
justsomeguy Posted August 24, 2009 Share Posted August 24, 2009 Add a UTF content-type to the page, IE is probably not using UTF when it sends out the request for the image. Link to comment Share on other sites More sharing options...
tal Posted August 25, 2009 Author Share Posted August 25, 2009 hy justsomeguyi have added "charset=utf-8" to the IMAGE header but still i get a square insted of the letter in IEheader('Content-type: image/gif; charset=utf-8');once again thank you for helping Tal Link to comment Share on other sites More sharing options...
justsomeguy Posted August 25, 2009 Share Posted August 25, 2009 Not the image headers, the headers for the page that requests the image. Link to comment Share on other sites More sharing options...
tal Posted August 29, 2009 Author Share Posted August 29, 2009 hy justsomeguyexcuse me for my ignorance but i am confused at how and where to do that - do i do that in the apache conf ?- do i do that with adding a line to my html file ?- do i do that with a php function ?thank you for your time Tal Link to comment Share on other sites More sharing options...
dsonesuk Posted August 29, 2009 Share Posted August 29, 2009 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.