|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-02-06 09:16 UTC] bugs at jth dot net
Description: ------------ default_charset in php7 is now a mess being used in two different contexts. It should be two different options: one for internal encoding and one for enabling/disabling being output in the Content-Type: header. The Content-Type: header is overriding the meta tag in the document, which different users are creating in different charsets using the meta tag. php is often used for simple functions not involving or regardless of the charset e.g. database functions. It is a nuisance and prone to error having the users to specify the charset both as an unnecessary header() call and as a meta tag. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
This explains one of the issues more clearly than the OP here: stackoverflow dot com / questions / 46484185 If the specific issue raised there should be a separate bug report, please advise or create one. However, it is noted in comment 2018-02-06 10:24 UTC by requinix that > setting default_charset empty is currently the only way I see to prevent adding the charset= to the Content-Type So this is perhaps what this bug is about? If so, it's also possible to somewhat circumvent the bug by using `\header('Content-Type: text/html; charset=');`, but the `charset=` (with nothing following) still appears in the HTTP headers (though doesn't seem to override that in the document, or cause any other problem, with browsers I've tested against). That's clearly not an ideal solution. I might give `\ini_set('charset', null)` a go (restoring it after calling `header`) to see if that indeed does work. Thanks for the tip. Bottom line: this is definitely a bug (or perhaps a poorly-implemented feature - and maybe one that no-one ever asked for, that could simply be removed).