Comments (7)
Please show me sample code and that Traceback or any error messages.
from cymysql.
Here is the error code, unfortunately, I cannot show everything:
That is just a normal error code when inserting an emoji into a table. However, the database and the tables are already set up in utf8mb4 (charset) and utf8mb4_unicode_ci (collation).
This is the CyMySQL code that does not work:
connection = cymysql.connect(host=host, port=port, user=user, passwd=password, db=db)
However, it's equivalent PyMySQL code works by just changing the module
connection = pymysql.connect(host=host, port=port, user=user, passwd=password, db=db)
By explicitly specifying charset, CyMySQL works.
connection = cymysql.connect(host=host, port=port, user=user, passwd=password, db=db, charset='utf8mb4')
This is not the intended behavior of CyMySQL (based on source) for Python 3 as it should default to using unicode.
from cymysql.
Thanks, I understand.
Can you test with master HEAD branch on Github ?
from cymysql.
INSERT query works, however, it fails when SELECT is used to cross-check
E AssertionError: assert '\U0001f40d' == '\xf0\\x9f\\x90\\x8d'
E - \U0001f40d
E ? ^
E + \xf0\x9f\x90\x8d
E ? ^^^^
Here are the original and SELECTed data
🐍
�
Explicitly specifying charset='utf8mb4' will output the correct emoji. I believe, the decoding side was not set.
from cymysql.
thanks
I will support utf8mb4 charset.
from cymysql.
version 0.9.14 released
Please check it
from cymysql.
@nakagami Verified! Thank you!
from cymysql.
Related Issues (20)
- Exception closing connection HOT 1
- Does not seem to handle blobs larger than 8M. HOT 5
- data is returned as NULL when use_unicode=0 HOT 2
- Missing charset 46 (utf8mb4_bin) HOT 2
- Missing CR constants HOT 2
- To support IPv6 HOT 1
- Benchmarks HOT 2
- cymysql.err.InternalError: (1043, 'Bad handshake') HOT 5
- InternalError: (1043, u'Bad handshake') HOT 4
- Error Build with Cython HOT 3
- Package requires Crypto module, but makes no mention of this. HOT 2
- Limited support: authentication plugins HOT 10
- LookupError: unknown encoding: utf8mb4 HOT 4
- No support for SSCursor? HOT 1
- cymysql.err.InternalError: (1043, 'Bad handshake') HOT 9
- BrokenPipeError: [Errno 32] Broken pipe HOT 1
- Duda
- How do you enable local infile? HOT 1
- Sync with current PyMySQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cymysql.