fix: normalize default charset to lowercase utf-8#6856
Merged
chenjiahan merged 1 commit intomainfrom Dec 29, 2025
Merged
Conversation
2 tasks
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes the default HTML charset from uppercase UTF-8 to lowercase utf-8 to align with HTML Living Standard examples. The change is purely cosmetic since charset parsing is case-insensitive, resulting in no behavioral changes.
- Updated default charset configuration from
'UTF-8'to'utf-8' - Updated all documentation examples (English and Chinese) to reflect the new format
- Updated test snapshots and E2E test expectations to match the new default
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
website/docs/zh/guide/basic/html-template.mdx |
Updated Chinese documentation example to show lowercase utf-8 |
website/docs/zh/config/html/meta.mdx |
Updated Chinese API documentation and examples with lowercase utf-8 |
website/docs/en/guide/basic/html-template.mdx |
Updated English documentation example to show lowercase utf-8 |
website/docs/en/config/html/meta.mdx |
Updated English API documentation and examples with lowercase utf-8 |
packages/core/tests/__snapshots__/html.test.ts.snap |
Updated test snapshots to expect lowercase utf-8 charset |
packages/core/tests/__snapshots__/environments.test.ts.snap |
Updated environment config test snapshots for charset normalization |
packages/core/tests/__snapshots__/default.test.ts.snap |
Updated default config test snapshots with lowercase charset |
packages/core/tests/__snapshots__/builder.test.ts.snap |
Updated builder test snapshots to reflect new default |
packages/core/src/types/config.ts |
Updated TypeScript type documentation to show lowercase default |
packages/core/src/defaultConfig.ts |
Changed actual default value from 'UTF-8' to 'utf-8' |
e2e/cases/server/ssr/template.html |
Updated SSR template to use lowercase charset |
e2e/cases/server/ssr-type-module/template.html |
Updated SSR type module template to use lowercase charset |
e2e/cases/html/template-no-head/index.test.ts |
Updated E2E test expectation for lowercase charset |
e2e/cases/html/inject/index.test.ts |
Updated HTML injection test expectations to match new default |
e2e/cases/html/html-tags/function-usage/index.test.ts |
Updated HTML tags test expectation for lowercase charset |
e2e/cases/html/html-loader/src/template.html |
Updated html-loader template to use lowercase charset |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The default HTML charset is now emitted as lowercase
utf-8, matching the HTML Living Standard examples. Charset parsing remains case-insensitive, so there is no behavioral change.Related Links
Checklist