You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some commands under aws s3 will set a mime type while uploading files. This is based on a type inference system. When the type inference system results in a type starting with text/ it should try to append ; charst=<charset> or at least offer the option to do so.
There's a number of ways this might be inferred and I'm agnostic as to which:
Use environment variables provided by the system
Add an explicit switch to set the charset
Try to guess the charset based on content
Use Case
Where an S3 backed cloud-front website may serve plain text files, there is no other way to indicate the charset of the file. As it stands, the current behaviour forces clients to assume US-ASKII or ISO-8859-1 and this is very rarely right.
The use of an explicit charset parameter is strongly recommended. While [MIME] specifies "The default character set, which must be assumed in the absence of a charset parameter, is US-ASCII."
As it stands the only way to achieve this is to completely bypass the type inference system which means users are left to build their own inference system.
By allowing the client set set a charset for either all text/* types or otherwise specifically set charset for specific mime types such as text/plain, these can then be set correctly in S3 and thus be correct when retrieved through cloud-front.
Proposed Solution
Add an option to set the charset explicitly for text types, or alternatively add an option to infer the charset from the current console's environment variables. This would append ; charset=... to each text mime type. Eg: text/plain; charset=utf-8.
Other Information
No response
Acknowledgements
I may be able to implement this feature request
This feature might incur a breaking change
CLI version used
2.15.24
Environment details (OS name and version, etc.)
Macos / Linux
The text was updated successfully, but these errors were encountered:
Describe the feature
Some commands under
aws s3
will set a mime type while uploading files. This is based on a type inference system. When the type inference system results in a type starting withtext/
it should try to append; charst=<charset>
or at least offer the option to do so.There's a number of ways this might be inferred and I'm agnostic as to which:
Use Case
Where an S3 backed cloud-front website may serve plain text files, there is no other way to indicate the charset of the file. As it stands, the current behaviour forces clients to assume US-ASKII or ISO-8859-1 and this is very rarely right.
RFC 2854 Section 6
As it stands the only way to achieve this is to completely bypass the type inference system which means users are left to build their own inference system.
By allowing the client set set a charset for either all
text/*
types or otherwise specifically set charset for specific mime types such astext/plain
, these can then be set correctly in S3 and thus be correct when retrieved through cloud-front.Proposed Solution
Add an option to set the charset explicitly for text types, or alternatively add an option to infer the charset from the current console's environment variables. This would append
; charset=...
to each text mime type. Eg:text/plain; charset=utf-8
.Other Information
No response
Acknowledgements
CLI version used
2.15.24
Environment details (OS name and version, etc.)
Macos / Linux
The text was updated successfully, but these errors were encountered: