April 20, 200917 yr Hi all, More php questions from me Basically I have this code: <div id="content"> <h1><?php echo $row_ProductDetail['title']; ?> </h1> <p><?php echo nl2br($row_ProductDetail['copy']); ?></p> <p><a href="logged-in.php" class="intext">Click here to return to the customer section</a></p> </div> to display my products detail - the nl2br() function works perfectly for the user to be able to just put line breaks in, but when they add in quote marks they end up as these weird little white-out-of-black question marks in a diamond (i hope that makes sense) EDIT: ����� these things... So is there an easy way to make the quotes display as quotes? Help me please Cheers
April 20, 200917 yr Have you checked the HTML source for the page rather than just the browser's rendering? I sometimes get this on Linux when the font doesn't have the required glyphs (or for some reason the browser can't interpret those glyphs correctly). My guess would be that the source is okay, and if you changed font (or even browser/operating system), it'd be fine. That's only a guess though
April 20, 200917 yr Author Well the Glyphs are in the source code too - so it appears to be happening when it is pulling in from the DB to the HTML - because in phpMyAdmin they look fine Any ideas? Cheers
April 20, 200917 yr Author Thanks for that Sumeet - but I know how to do that - the client however, doesn't and they will be entering stuff into the database... so giving them an ASCII table to memorize and getting them to replace characters will not help at all... other ideas of how to do this with PHP/MySQL are much appreciated
April 20, 200917 yr You mentioned that it displays fine in phpMyAdmin... so the real question is, what is the difference between that and your site? Does it do entity replacement on funny characters? Is it using a different font? I'd try to narrow down exactly what the difference is to move forward with a solution. Other possible ideas: the character encoding in the submitted form doesn't match that of the database or that of the final display page, so a few odd characters are being mangled (ISO-8859-1 is a superset of UTF-8 and generally a good choice because it holds many additional common symbols like the £ pound sterling sign); it could be that the browser is using angled quote marks on submission or display, and the font does not support these. Either way, what is the actual data in the database table? Does it actually use straight quote marks, or is it holding angled ones which have a different Unicode glyph value? Just some ideas there.
Create an account or sign in to comment