mtasa-blue
mtasa-blue copied to clipboard
[New bug] Certain characters like emojis passed from a client, aren't received correctly by server
Describe the bug
After updating MTA server I started getting warnings about unable to insert into MySQL such as:
[script] FAIL: (1366) Incorrect string value: '\xED\xA0\xBD\xED\xB8\x81' for column 'msg' at row 1 [Query:INSERT INTO my_history (time, acc, msg) VALUES (1717270392, 'Arran', 'ð')]
I narrowed it down to r22396 that has MySQL changes: https://buildinfo.multitheftauto.com/index.php?Revision=22396&Branch=
Steps to reproduce
- Windows 64 bit server with v1.6-release-22396 running.
- MySQL server you can dbConnect to.
- srun dbcon = dbConnect("mysql", "dbname=dbnamehere;host=localhost", "user", "password")
- srun dbExec(dbcon, "INSERT INTO table (message) VALUES (?)", "ð")
- Get error like FAIL: (1366) Incorrect string value: '\xED\xA0\xBD\xED\xB8\x81' for column 'msg' at row 1
Note that I have the MySQL table set to utf8mb4 and have also tried passing charset=utf8mb4 with dbConnect but it makes no difference. Only using the revision before this fixes it. I checked what gets inserted in the previous version and MySQL workbench shows: à½Ã¸ for ð
Version
Windows 64 bit v1.6-release-22396
Additional context
No response
Relevant log output
No response
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.