simplified rcltext. No need for awk and no assumptions on charset
This commit is contained in:
parent
85f155bbf4
commit
8d43ef3b30
@ -83,27 +83,9 @@ umask 77
|
|||||||
# !! Leave the following line unmodified !
|
# !! Leave the following line unmodified !
|
||||||
#ENDRECFILTCOMMONCODE
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds awk iconv
|
checkcmds awk
|
||||||
|
echo '<html><head><title></title></head><body><pre>'
|
||||||
|
|
||||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
sed -e 's/\&/\&/g' -e 's/</\</g' "$infile"
|
||||||
# is an awk program
|
|
||||||
sed -e 's/.//g' -e 's/.//g' "$infile" |\
|
|
||||||
awk 'BEGIN'\
|
|
||||||
' {
|
|
||||||
print "<html><head><title></title>"
|
|
||||||
print "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
|
|
||||||
print "</head>\n<body>\n<p>"
|
|
||||||
}
|
|
||||||
{
|
|
||||||
gsub(/&/, "\\&", $0)
|
|
||||||
gsub(/</, "\\<", $0)
|
|
||||||
gsub(/>/, "\\>", $0)
|
|
||||||
|
|
||||||
print $0 "<br>"
|
echo '</pre></body></html>'
|
||||||
}
|
|
||||||
END {
|
|
||||||
print "</p></body></html>"
|
|
||||||
}' | iconv -f iso-8859-1 -t UTF-8 -c -s
|
|
||||||
|
|
||||||
# exit normally
|
|
||||||
exit 0
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user