leafer Posted February 8, 2010 Share Posted February 8, 2010 I've tried everything (htmlspecialchars, htmlentities, html_entity_decode with ENT_QUOTES) and nothing seems to work. It keeps displaying a blue boxed question mark in place of the single quote. The portion of the sentence not displaying properly is "john's". I've manually inserted the info using myphpadmin if that makes a difference. Thx Quote Link to comment Share on other sites More sharing options...
Goldeneye Posted February 8, 2010 Share Posted February 8, 2010 You said you manually inserted the sentence into your database. Does your single-quote happen to be an apostrophe? If it's an actual apostrophe, you might want to try: <?php htmlentities($str, ENT_COMPAT, 'UTF-8'); ?> Quote Link to comment Share on other sites More sharing options...
leafer Posted February 8, 2010 Author Share Posted February 8, 2010 You said you manually inserted the sentence into your database. Does your single-quote happen to be an apostrophe? If it's an actual apostrophe, you might want to try: <?php htmlentities($str, ENT_COMPAT, 'UTF-8'); ?> It's the key to the left of enter not the one with the tilde sign (~). I tried your method above but now the line itself doesn't display. Quote Link to comment Share on other sites More sharing options...
leafer Posted February 9, 2010 Author Share Posted February 9, 2010 No one? Quote Link to comment Share on other sites More sharing options...
jl5501 Posted February 9, 2010 Share Posted February 9, 2010 do you have the exact text that is stored in mysql that you can show us? Quote Link to comment Share on other sites More sharing options...
leafer Posted February 9, 2010 Author Share Posted February 9, 2010 do you have the exact text that is stored in mysql that you can show us? "I'm going over to John's house" Quote Link to comment Share on other sites More sharing options...
leafer Posted February 10, 2010 Author Share Posted February 10, 2010 Quote Link to comment Share on other sites More sharing options...
jl5501 Posted February 10, 2010 Share Posted February 10, 2010 so it is actually stored in the db like that not as "I\'m going over to John\'s house" which is how it would normally be stored if mysql_real_escape_string() or addslashes() had been used Quote Link to comment Share on other sites More sharing options...
leafer Posted February 10, 2010 Author Share Posted February 10, 2010 I've manually inserted the info using myphpadmin if that makes a difference. Quote Link to comment Share on other sites More sharing options...
sader Posted February 10, 2010 Share Posted February 10, 2010 Maybe something wrong with encode in your tables field? Mayebe u set some exotic charcase for document with <meta>? is your php file saved in utf-8 mode? thats some ideas that I got... Quote Link to comment Share on other sites More sharing options...
jl5501 Posted February 10, 2010 Share Posted February 10, 2010 It is reasonably certain that if the manually entered data was changed in line with my last post, then you would be able to extract it, apply stripslashes() to it, and have it displayed correctly. With an unescaped single quote in the db data, then in theory it ought to be displayable if placed in double quotes, and it would be interesting to hear anyone elses analysis of that situation Quote Link to comment Share on other sites More sharing options...
leafer Posted February 10, 2010 Author Share Posted February 10, 2010 It's not entered in with double quotes I just used double quotes to signify the entire sentence I used. Quote Link to comment 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.