Closed
Description
If I try to build an update that set a a field to a string containing unicode characters (in this example I put an emoji) I get this error:
(node:29099) UnhandledPromiseRejectionWarning: Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xF0\x9F\x98\x98' for column 'title' at row 1
I'm using mysql, should I use an extension for mysql or something?
I get the same error if I try to run the generated query directly in Sequel Pro
, so I think the emoji symbol has to be escaped to unicode, eg. '\\u00F0\\u009F\\u0098\\u0098'
I'm getting this results using toParams method:
{ text: 'UPDATE recipes SET id = ?, title = ?, body = ? WHERE id = ?',
values:
[ '1',
'fagioli alla messicana 😗',
'Apri i fagioli, aggiungi la salsa e l\'aglio, cuoci. \r\nA fuoco lento o rovini tutto. \r\nPepa tanto.',
'1' ] }
Metadata
Metadata
Assignees
Labels
No labels