From e4576fc12f3e968f6dcfe08bbb5f7cf3cec5c728 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 27 Aug 2019 08:32:50 +0200 Subject: [PATCH] rcltex: try to detect character encoding --- src/filters/rcltex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/filters/rcltex b/src/filters/rcltex index bcddb3b1..981634a9 100755 --- a/src/filters/rcltex +++ b/src/filters/rcltex @@ -77,6 +77,16 @@ umask 77 # !! Leave the following line unmodified ! #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 checkcmds iconv CMD="detex -n -e ''" @@ -93,7 +103,7 @@ cat <'