-
Notifications
You must be signed in to change notification settings - Fork 128
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
[Theme] Specify charset for HTML responses #4512
Conversation
Thanks for your contribution! Depending on what you are working on, you may want to request a review from a Shopify team:
|
/snapit |
🫰✨ Thanks @frandiox! Your snapshot has been published to npm. Test the snapshot by intalling your package globally: pnpm i -g @shopify/[email protected]
|
Coverage report
Test suite run success1894 tests passing in 860 suites. Report generated by 🧪jest coverage report action from dc30dca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @frandiox!
WHY are these changes introduced?
Fixes #4479 again, after being reopened with a slightly different issue.
I'm unsure why, but it looks like SFR doesn't add the charset encoding when called from development. It seems to be adding it to production sites, however. The legacy CLI was also adding this (not sure if manually or by calling the API in a different way). cc @karreiro do you perhaps have more context on this?
Note: SFR and legacy CLI are not adding the charset encoding to JS / CSS assets so I've not changed that 🤔
WHAT is this pull request doing?
For themes that don't specify
<meta charset="utf-8">
in the layout, certain characters are not rendered correctly:This PR adds the proper charset to the contet-type for HTML responses so things are rendered correctly:
How to test your changes?
<meta charset="utf-8">
from your layout.××hey××Пи好
in any section.Without this PR it won't render correctly.
cc @Shopify/advanced-edits