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

tables.rb: Generate UTF-8 strings when possible. #70

Merged
merged 1 commit into from
May 10, 2022

Conversation

casperisfine
Copy link

Strings in tables.rb for the most part are common occurences. MIME types and extension names are extremely likely to be referenced in other gems and in the host application.

As such it's preferable to define them in the default encoding so that the same interned string can be re-used.

The exception being the magic strings, they need to be binary.
For them we generate them with the .b.freeze suffix.

cc @gmcgibbon

Strings in `tables.rb` for the most part are common occurences.
MIME types and extension names are extremely likely to be referenced
in other gems and in the host application.

As such it's preferable to define them in the default encoding
so that the same interned string can be re-used.

The exception being the magic strings, they need to be binary.
For them we generate them with the `.b.freeze` suffix.
@byroot byroot merged commit 3268ef1 into rails:main May 10, 2022
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.

3 participants