Cannot send emojis through forms 😢

Hello!

My Retool app is plugged to a MySQL database in utf8mb4 in which I can insert emojis without any problem.

But when I sent content to the very same base with an emoji through a Retool form, I get this error : ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xF0\x9F\xA4\x94' for column 'first_name' at row 1.

Is there some kind of javascript conversion I should make before sending content with emojis?

Hey @Greg! A frustrating problem indeed - looks like there’s some sort of conversion going on behind the scenes. The \xF0\x9F\xA4\x94 value is the representation in UTF-8 bytes. This thread might help? https://stackoverflow.com/questions/17191945/conversion-between-utf-8-arraybuffer-and-string

Hello Justin and thanks for your answer! :+1:

I have tried with the conversion function in your link. So I have one transformer to ‘encode’ the string before sending it to my db and another one to ‘decode’ it to read it. The encoding part is working but the decoding part isn’t. But even if it was, I have two main issues with this approach :

  • the value stored in my db will look like {"0":85,"1":71,"2":86,[...]"34":61,"35":61}
  • I’ll have to write an encoding transformer and a decoding transformer for every fields of my form where emojis can be typed (around 20 fields so 40 transformers :sob:)

What I don’t understand is when is made the conversion from an emoji character to its utf8 bytes representation?