I am trying to insert UTF-8 characters into a MySQL table using Lucee and having no luck.
- I have the MySQL table set to use utf8mb4_unicode_ci but have also tried utf8mb4_bin.
- I have tried Apache both with and without "AddDefaultCharset UTF-8" enabled.
- The connection string to the database includes "characterEncoding=UTF-8"
- Lucee config includes UTF-8 in the charset settings.
The code I am running is as follows...
<cfset textValue = ' Person Raising Hand'>
<cfdump var="#textValue#">
<cfquery name="insert">
INSERT INTO TEST_UTF8 (TestText)
VALUES ('#textValue#');
</cfquery>
The dump works fine and displays as it should but the insert returns the following error...
"Incorrect string value: '\xF0\x9F\x99\x8B P...' for column 'TestText' at row 1"
I have tried inserting the same string via phpmyadmin and it goes in fine suggesting that the MySQL config is okay.