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

cast: JSON is always UTF8 #176

Merged
merged 1 commit into from
Apr 29, 2024
Merged

cast: JSON is always UTF8 #176

merged 1 commit into from
Apr 29, 2024

Conversation

mattrobenolt
Copy link
Member

This regressed here: 7637705

@mattrobenolt mattrobenolt requested a review from ayrton April 29, 2024 16:00
mattrobenolt referenced this pull request Apr 29, 2024
* Fix cast logic

There's a lot to unpack here, but the tl;dr is to refer to the charset
ultimately to determine if the data is UTF8, if it is, we can decode it
to a UTF8 string.

This fixes behavior around CHAR/TEXT fields with a binary collation,
being surfaces as BINARY/BLOB types by MySQL.

For all intents and purposes, BLOB/BINARY/CHAR/TEXT are all effectively
identical and interchangeable, the only differentiator is their charset.
Either they are a UTF-8 charset, or a binary charset or some other
charset.

Fixes #169

---------

Co-authored-by: Ayrton <git@ayrton.be>
@mattrobenolt mattrobenolt merged commit 0bba907 into main Apr 29, 2024
5 checks passed
@mattrobenolt mattrobenolt deleted the json-utf8 branch April 29, 2024 16:06
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

Successfully merging this pull request may close these issues.

2 participants