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

Set encoding for write pipe #364

Merged
merged 2 commits into from Jul 26, 2021

Conversation

ngan
Copy link
Contributor

@ngan ngan commented Jul 26, 2021

This fixes the Encoding::UndefinedConversionError error for Rails applications. Rails sets the default encoding to UTF8: https://github.com/rails/rails/blob/main/railties/lib/rails.rb#L22-L23

We want to set it to Binary but the IO.pipe method only sets it for the reader, not the writer.

This fixes #243.

ngan added 2 commits July 26, 2021 09:29
This fixes the `Encoding::UndefinedConversionError` error for Rails
applications. Rails sets the default encoding to UTF8:
https://github.com/rails/rails/blob/main/railties/lib/rails.rb#L22-L23

We want to set it to Binary but the IO.pipe method only sets it for the
reader, not the writer.
@ngan
Copy link
Contributor Author

ngan commented Jul 26, 2021

@byroot @casperisfine wdyt?

@casperisfine
Copy link
Contributor

Hum, CI is failing but for a totally unrelated reason (likely load order). I'll fix it on master.

@casperisfine casperisfine merged commit 6c89cf9 into Shopify:master Jul 26, 2021
@casperisfine
Copy link
Contributor

And thank you!

@ngan ngan deleted the fix-encoding-for-rails-apps branch July 26, 2021 17:16
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems July 26, 2021 17:23 Inactive
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.

Encoding::UndefinedConversionError when added Bootsnap (Rails 5.2.2 / Ruby 2.6.1).
2 participants