How to get PHP to stop 'mis-rendering' some entities like ™ and single smart quotes.
November 28, 2005 6:22 PM
Subscribe
WebDevFilter: ™, ', and ' walk into my database, but only ô, ë, and í come back out.
I'm pulling a passage of text for a web site out of a mySQL database using PHP. Pretty generic stuff.
This particular passage has the ™ character sprinkled throughout it. In the phpMyAdmin tool, I can see the ™ with no problems. In the form I built to edit this text, the ™ shows up just fine as well. However, when the passage is pulled from the database and echoed, every ™ turns into a ô. Also, 'smart' single quotes are getting converted to ë and í, respectively. There may be other conversions going on, but I haven't noticed them yet.
FWIW, the only thing the form does is run the string through htmlspecialchars() and addslashes() before inserting back to the db.
What am I doing wrong?
posted by Wild_Eep to computers & internet (12 comments total)
1 user marked this as a favorite
posted by cillit bang at 6:25 PM on November 28, 2005