We have a website that allows a user to enter their car registration in a search box. We just got some errors from the website because of some dodgy characters also being paste in to the search box:
vrm=AB55CBX%E2%80%8F
So the number plate is "AB55CBX" but for some reason the following is added to the string "%E2%80%8F"
My code threw this error when trying query the database for that number plate:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='' in
What should I be doing to clean this up? I'm already using PDO and binding the value before executing it.