Skip to content

Commit be7447a

Browse files
authored
Merge pull request #22 from john-shaffer/21-character-encoding
Set charset=UTF-8 metadata for ContentTypes starting with "text/".
2 parents 5417286 + 5833e08 commit be7447a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Deployer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public function upload_files( string $processed_site_path ) : void {
8282
ltrim( $cache_key, '/' );
8383

8484
$mime_type = MimeTypes::GuessMimeType( $filename );
85+
if ( "text/" === substr( $mime_type, 0, 5 ) ) {
86+
$mime_type = $mime_type . '; charset=UTF-8';
87+
}
8588

8689
$put_data['Key'] = $s3_key;
8790
$put_data['Body'] = file_get_contents( $filename );

0 commit comments

Comments
 (0)