go to bug id or search bugs for
Seems like PHP cuts out attributes, including charset, from "Content-Type" when assigning the "type" attribute in file uploads: https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/main/rfc1867.c#L1180
That's information loss, this information is important when processing text uploads.
I realize doing the right thing (assigning full type to "type") is now not an option for BC reasons.
But I'd like to propose that we add another field to the $_FILES file entry, "charset", which contains the charset when it's there (and when it's not, the field can be missing or null).
Add a Patch
Add a Pull Request
Could you post an example for content-type string so that when it gets fixed, someone has an example to add as a test.
It's covered here (and elsewhere):
Basically it looks like (the names ARE CASE-INSENSITIVE, much like header names):
Content-Type: text/plain; charset=utf-8
The charset is not always supplied, but in some cases it is. It's possible that other attributes may also be appended in the same fashion, but I don't think any are documented right now (there's the boundary but that's only for multipart content)