Thanks in advance this is totally driving me crazy.
MySQL/PHP+GD/gif/truetype environment. My client uses an HTML form to submit a text string to a mysql database. next, that string is pulled back out and GD and a .ttf font is used to create a .gif of that text string. the image is created in a web subdirectory (i.e. titles/236.gif, named by ID of the string) and later, when the front-end web page is requested, that image is called traditionally with <img src>.
This works for thousands of images throughout the site
(See www.centerforward.com/~matthewm/staging)
I'm having the single quote / apostrophe problem basically. -- In some cases, and i'm not even sure this is consistent, a single quote in the original input field on the form will appear as an 'empty square outline' character with or without the single quote in the resulting gif image.
This is where it gets weird: I typically use firefox to develop/browse until i have to check final output in IE for everyone else.
The following fix works when i test it with firefox:
[ client submits form where ex_title = "Artists' Sketchbook"]
[ vars posted to table ]
[ title field selected from table ]
$ex_title = strtoupper($ex_row[ex_title]);
$ex_title = (stripslashes($ex_title));
$ex_title = ereg_replace("'","’",$ex_title);
[ gif image is then created from $ex_title ]
replacing the single quote with ’ as above works great when i walkthrough the process in FIREFOX: i use the "site management tool" to fill out the form with a title string like "Artists' Sketchbooks" , submit the form, then the site management tool displays the resulting GIF image of "Artists' Sketchbooks" properly with a graphical truetype single quote.
BUT when i submit the same form the same way in INTERNET EXPLORER, the resulting image has the 'empty square outline' in the resulting GIF image where the single quote should be.
I guess I don't understand enough about how GD works, cause i thought it was basically "server-side", so that if, i use a PHP template on the server to tell GD to create a GIF with a graphical quote in it (’😉, gd would take that input and and create the gif on the server in the same way, regardless of which browser calls up the resulting image later, or which browser submitted the original string-with-single-quote.
But what seems to happen is, if IE is used to submit a standard single quote to the DB, when a PHP template pulls the string back out (still with the standard single quote), and ereg_replace replaces it with ’ the image created on the server?? will have an empty square. (whether viewed later in IE or firefox).
If FIREFOX is used to submit the single quote to the DB and a PHP template pulls it back out and replaces it with ’ and creates a gif image on the server, that gif will have a formatted single quote. (whether viewed later in IE or firefox).
If ereg_replace recognizes that same standard single quote either way whether it posted from IE or FIREFOX, shouldn't everything beyond that point be independent of the browser? ...replacing with ’ and creating the gif... how come the php template that uses GD to make the gif doesn't make the same gif regardless of the browser that posted the text?
That's where i'm totally stuck and i can't find anyone else having this problem in support forms, searching etc...
Any help is greatly greatly appreciated!!!!!!
alan at centerforward dot com