]> gitweb.pimeys.fr Git - scripts-20-100.git/commitdiff
?
authorVincent Le Gallic <legallic@crans.org>
Sun, 20 Oct 2013 22:27:34 +0000 (00:27 +0200)
committerVincent Le Gallic <legallic@crans.org>
Sun, 20 Oct 2013 22:27:34 +0000 (00:27 +0200)
reencode.sh [new file with mode: 0755]

diff --git a/reencode.sh b/reencode.sh
new file mode 100755 (executable)
index 0000000..41de488
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+encoding=$(file "$1" | sed 's/.*: \([^ ]*\).*/\1/')
+#echo $encoding
+
+if [ "$encoding" = "assembler" ]
+then
+#   recode iso8859-1..utf-8 "$1"
+   exit 0
+fi
+
+if [ "$encoding" != "UTF-8" ]
+then
+   true
+   file "$1"
+fi