Handle garbled unrtf http-equiv header causing pbs with html5 handler
This commit is contained in:
parent
ec87379015
commit
fde36ecccc
@ -83,6 +83,7 @@ checkcmds awk unrtf
|
||||
# output the result
|
||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||
# is an awk program
|
||||
# The thing about the charset is that unrtf outputs a garbled one.
|
||||
unrtf --nopict --html "$infile" 2> /dev/null |
|
||||
awk 'BEGIN'\
|
||||
' {
|
||||
@ -90,10 +91,11 @@ awk 'BEGIN'\
|
||||
}
|
||||
/<\/head>/{
|
||||
if (gothead == 0) {
|
||||
printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n")
|
||||
printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n")
|
||||
gothead = 1
|
||||
}
|
||||
}
|
||||
/<meta http-equiv=/{next}
|
||||
{
|
||||
print
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ message/rfc822 = internal
|
||||
text/calendar = execm rclics;mimetype=text/plain;charset=utf-8
|
||||
text/html = internal
|
||||
text/plain = internal
|
||||
text/rtf = exec unrtf --nopict --html;charset=iso-8859-1;mimetype=text/html
|
||||
text/rtf = exec unrtf --nopict --html;mimetype=text/html
|
||||
text/x-c = internal
|
||||
text/x-c++ = internal
|
||||
text/x-c+ = internal
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user