Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Add utf8 charset explicitly to table definitions #150

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

andynu
Copy link
Contributor

@andynu andynu commented Jun 8, 2022

For any databases that do not have utf8 as the default. Without this
setting the tables are created with the default, but are treated as
utf8, which can result in errors:

ERROR 1366 (HY000): Incorrect string value: '\xE2\x84\xAF\x0A -...' for column 'response_body' at row 1

This came up in the context of a legacy MySQL application.
The kind of project where this project is exceedingly useful!


Before submitting, please review the contributor guidelines. In particular:

  • Your tests pass on all supported Rails versions. Run bin/appraisal rspec to verify.
  • Your code adheres to the repository code style. Run bin/rake lint to verify.
  • [N/A] For functional updates, has the documentation been updated accordingly?

For any databases that do not have utf8 as the default. Without this
setting the tables are created with the default, but are treated as
utf8 which can result in errors:

   ERROR 1366 (HY000): Incorrect string value: '\xE2\x84\xAF\x0A -...' for column 'response_body' at row 1
@hschne
Copy link
Owner

hschne commented Jun 10, 2022

Excellent fix, thanks for submitting this! 🙌

@hschne hschne merged commit 1dab8a8 into hschne:main Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants