3 # This script is based on /usr/share/lighttpd/create-mime-assign.pl. This
4 # script is changed to include a charset for text types.
7 open MIMETYPES, "/etc/mime.types" or exit;
8 print "mimetype.assign = (\n";
14 if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) {
15 my $mime = $1; my $exts = $2;
16 # Append encoding for text formats
17 if ($mime =~ /^text\//) {
18 $mime .= "; charset=iso-8859-1";
20 foreach(split / /, $exts) {
21 # mime.types can have same extension for different
23 next if $extensions{$_};
26 print "\".$_\" => \"$mime\",\n";