Skip to content

[HttpFoundation] Use lowercase utf-8 as default response charset #60685

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

Open
wants to merge 2 commits into
base: 7.4
Choose a base branch
from

Conversation

jnoordsij
Copy link
Contributor

Q A
Branch? 7.4
Bug fix? no
New feature? no
Deprecations? no
Issues N/A
License MIT

Per the recommendations I found on https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type#media-type and https://www.rfc-editor.org/rfc/rfc9110.html#section-8.3.1, it seems that using the lowercase variant is considered to be preferable.

An alternative approach would be to actually convert any charset argument to lowercase, which I would also be willing to implement if preferable. However, this is slightly more invasive, although it should function practically equivalent on any (modern) browser.

@carsonbot carsonbot added this to the 7.4 milestone Jun 4, 2025
@carsonbot carsonbot changed the title Use lowercase utf-8 as default response charset [HttpFoundation] Use lowercase utf-8 as default response charset Jun 4, 2025
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Works for me on 7.4. I wouldn't do any normalization so good as is to me.

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.

4 participants