Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(node:12454) UnhandledPromiseRejectionWarning: Error: Encoding not recognized #1333

Closed
qishuo opened this issue Jun 4, 2021 · 5 comments
Closed

Comments

@qishuo
Copy link

qishuo commented Jun 4, 2021

(node:12454) UnhandledPromiseRejectionWarning: Error: Encoding not recognized: 'undefined' (searched as: 'undefined')
at Object.getCodec (/Users/x/xx/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:106:23)
at Object.getEncoder (/Users/x/xx/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:117:23)
at Object.exports.encode (/Users/x/xx/node_modules/mysql2/lib/parsers/string.js:23:25)
at Query.toPacket (/Users/x/xx/node_modules/mysql2/lib/packets/query.js:16:30)
at Query.start (/Users/x/xx/node_modules/mysql2/lib/commands/query.js:55:38)
at Query.execute (/Users/x/xx/node_modules/mysql2/lib/commands/command.js:39:22)
at Connection.handlePacket (/Users/x/xx/node_modules/mysql2/lib/connection.js:408:32)
at Connection.addCommand (/Users/x/xx/node_modules/mysql2/lib/connection.js:430:12)
at Connection.query (/Users/x/xx/node_modules/mysql2/lib/connection.js:493:17)

@vivi2015
Copy link

vivi2015 commented Jun 17, 2021

i am encounter same issue
check mysql character
企业微信截图_16238978147374
mysql2 do not support utf8mb3
image

change utf8mb3 to utf8mb4

@sidorares
Copy link
Owner

closing this one, #1398 tracks same issue

@egorovd
Copy link

egorovd commented Oct 6, 2021

I'll continue here ...

I have such a version on the server (I have not tested others from the 8th version)

Screenshot_1246

And there are such variables :
Screenshot_1245

How else can I help?

@sidorares
Copy link
Owner

hm, the docs say that utf8mb3 is an alias for "utf8" encoding, which for historical reasons is acually a "cesu-8" encoding ( see #374 (comment) )

@dougwilson do you have an experience with utf8mb3 in mysql? Is it actually CESU-8 under the hood?

@dougwilson
Copy link
Collaborator

Yea, utfmb3 is just an alias for utf8 (which is CESU-8). It was added when utf8mb4 was in order to, I guess, have aliases for utf8 that specify the number of bytes. TL;DR utf8 mysql encoding is simply an alias to utf8mb3 (https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants