Skip to content

Feature request: support unicode characters. #102

Closed
@parro-it

Description

@parro-it

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions