Description:
Hi,
with reference to this fixed bug:
https://bugs.mysql.com/bug.php?id=104346
I made some test saving and retrieving emoticons on a default installation of MySql 8.0.28 and I found some problems analyzed below.
How to repeat:
And here are the results selecting and inserting this chars: 🥰❤️
TEST 1 SELECT (classic asp, no charset indicated in the connection)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;"
Result: 🥰❤️
----------
TEST 2 SELECT (classic asp, charset utf8)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;charset=utf8;"
Result: 🥰❤️ (the same of TEST 1)
----------
TEST 3 SELECT (classic asp, charset utf8mb4)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;charset=utf8mb4;"
Result: 🥰â¤ï¸
----------
So, SELECT strings containing emoticons is displayed incorrectly with charset "utf8mb4" and right with empty charset or "utf8" value. Is that right or maybe should it be the opposite?
INSERT operation instead gives always this error with any charset indicated:
-2147467259 - [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.28]Incorrect string value: '\xF0\x9F\xA5\xB0\xE2\x9D...' for column 'first_name' at row 1
So, the INSERT command doesn't work at all. Am I forgot something? I tested also another third party driver for MySQl and it works right both selecting and inserting emoticons, without any extra code.
Suggested fix:
I think that everything should be fine using "utf8mb4" charset in connection parameters, so maybe at the moment there are some conversions that are not made directly into the driver.
Best regards.