mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

[New bug] Certain characters like emojis passed from a client, aren't received correctly by server

Open ArranTuna opened this issue 8 months ago • 13 comments

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

  1. Windows 64 bit server with v1.6-release-22396 running.
  2. MySQL server you can dbConnect to.
  3. srun dbcon = dbConnect("mysql", "dbname=dbnamehere;host=localhost", "user", "password")
  4. srun dbExec(dbcon, "INSERT INTO table (message) VALUES (?)", "😁")
  5. 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.

ArranTuna avatar Jun 01 '24 20:06 ArranTuna