Encoding issue with form and HTML Purifier / MySQL
- by Andrew Heath
Driving me nuts...
Page with form is encoded as Unicode (UTF-8) via:
<meta http-equiv="content-type" content="text/html; charset=utf-8">
entry column in database is text utf8_unicode_ci
copying text from a Word document with " in it, like this: “1922.” is insta-fail and ends up in the database as â??1922.â?? (typing new data into the form, including " works fine... it's cut and pasting from Word...)
PHP steps behind the scenes are:
grab value from POST
run through HTML Purifier default settings
run through mysql_real_escape_string
insert query into dbase
Help?