I have a site that accepts form-based inputs from users and stores into a mysql(i) database. 99% of users are from the USA.
If a user is on a mobile device and decides it would be fun to use an emoji in one of the form fields, the resulting SQL causes a failure when the UPDATE or INSERT is attempted. This is due to the emoji being outside utf-8 and therefore a mis-match of encoding between the UX and the DB. I believe I understand the underlying issue.
I'm on mysql 5.5 so I could actually support utf8mb4 char set -- but it'll be some time before I can get around to that.
In the meantime, would it be ok/safe to just do this (in PHP):
$sql = "INSERT INTO my_table ... *long insert statement across two dozen rows*";
$sql = utf8_decode($sql);
$db->sql_query($sql);
So - simply force the entire SQL statement to utf-8? I realize emoji characters and some others may be converted to "?" -- but as long as the statement itself isn't broken or I don't lose normal text inputs from the users, I'll be ok with this.
Any issues with this idea as a temp fix until I can convert the table's schemas to work with utf8mb4?
EDIT: Error being returned from the database looks like this:
"Incorrect string value: '\xF0\x9F\x99\x8A...' for column..."