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

Fix Propshaft encoding issue #1096

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

yenshirak
Copy link
Contributor

@yenshirak yenshirak commented Jan 13, 2024

We get the following error after replacing Sprockets with Propshaft:
ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8)

This fix resolves the issue.

Propshaft::Asset#content returns an ASCII-8BIT encoded string because it's using File::binread under the hood so the encoding needs to be set to UTF-8 if it's a JS or CSS file.

Copy link
Contributor

@mathieujobin mathieujobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the Change log with your change?

@yenshirak
Copy link
Contributor Author

@mathieujobin done

@mathieujobin
Copy link
Contributor

@unixmonkey @mileszs Can we cut a release with this fix ?

@unixmonkey unixmonkey merged commit 9221f6d into mileszs:master Jan 23, 2024
12 checks passed
@yenshirak yenshirak deleted the propshaft-fix branch January 23, 2024 15:21
@unixmonkey
Copy link
Collaborator

This is now released in version 2.8.0 of the Wicked PDF gem. Thank you so much for your help!

Please let me know if you have any issues!

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.

None yet

3 participants