add tag
Hannah Vernon
I'm attempting to insert some UTF-8 data into MySQL on


I've tried various methods of formatting the string, however I invariably get an error along these lines:

> Incorrect string value: '\xF0\x9F\x98\xB2' for column 'v' at row 1

How do I get dbfiddle to accept a UTF-8-encoded string?
Top Answer
Paul White
`utf8` in MySQL is a synonym for `utf8mb3`, which encodes to a **maximum of three bytes**. You cannot encode the 😲 character in three bytes of UTF8.

The example given works using the sensible db<>fiddle default of `utf8mb4` (allowing the full range of up to four bytes):


This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.