rcltex: try to detect character encoding
This commit is contained in:
parent
e0d300ff58
commit
e4576fc12f
@ -77,6 +77,16 @@ umask 77
|
|||||||
# !! Leave the following line unmodified !
|
# !! Leave the following line unmodified !
|
||||||
#ENDRECFILTCOMMONCODE
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
# Try to detect encoding
|
||||||
|
encoding=`egrep '\usepackage\[.*\]{inputenc}' "$infile" | \
|
||||||
|
sed -e 's/.*\[//' -e 's/\].*//'`
|
||||||
|
if test "X$encoding" = X ; then
|
||||||
|
encoding=latin1
|
||||||
|
fi
|
||||||
|
if test "X$encoding" = Xutf8x ; then
|
||||||
|
encoding=utf8
|
||||||
|
fi
|
||||||
|
|
||||||
if iscmd detex ; then
|
if iscmd detex ; then
|
||||||
checkcmds iconv
|
checkcmds iconv
|
||||||
CMD="detex -n -e ''"
|
CMD="detex -n -e ''"
|
||||||
@ -93,7 +103,7 @@ cat <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
$CMD "$infile" | \
|
$CMD "$infile" | \
|
||||||
iconv -c -f iso-8859-1 -t utf-8 | \
|
iconv -c -f "$encoding" -t utf-8 | \
|
||||||
sed -e 's/</</g' -e 's/&/&/g'
|
sed -e 's/</</g' -e 's/&/&/g'
|
||||||
|
|
||||||
echo '</pre></body></html>'
|
echo '</pre></body></html>'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user