Skip to content

fix: normalize default charset to lowercase utf-8#6856

Merged
chenjiahan merged 1 commit intomainfrom
charset_value_1229
Dec 29, 2025
Merged

fix: normalize default charset to lowercase utf-8#6856
chenjiahan merged 1 commit intomainfrom
charset_value_1229

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

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

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 29, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 0663d23
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6951e0c4440e5c00089313ee
😎 Deploy Preview https://deploy-preview-6856--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 70 (🟢 up 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@chenjiahan chenjiahan merged commit 4adb70b into main Dec 29, 2025
18 checks passed
@chenjiahan chenjiahan deleted the charset_value_1229 branch December 29, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants