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 application/js-sourcemap+json charset to unicode #669

Merged
merged 3 commits into from
Jun 23, 2022

Conversation

andresakata
Copy link
Contributor

When upgrading the sprockets to the 4.x version, I started to get this exception in a specific asset of my project:

Encoding::UndefinedConversionError at "\xC3" from ASCII-8BIT to UTF-8

I found out that a custom transformer was receiving the data with an incorrect encoding when building the source map.

Registering the 'application/js-sourcemap+json with charset: :unicode solves the problem.

@chadlwilson
Copy link
Contributor

Hi @andresakata - I think I have exactly the same issue, but with an SCSS asset that contains a Unicode char instead.

Would it make sense to you that the same charset: :unicode might be appropriate for the default configuration of the line after the one you changed? I might submit a PR.

@andresakata
Copy link
Contributor Author

@chadlwilson yes, it does make sense to me!

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