summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2019-09-16 12:30:58 +0000
committerIan C <ianc@noddybox.co.uk>2019-09-16 12:30:58 +0000
commit6724198091eac18a38688cc8df08f625fde7892b (patch)
treef33056f1284eaf6d2c9b2d076c35ba0f27bf7ada
parent72ef76cce94fa6ebeacfa26e87d6512c1960f5cf (diff)
Added ansi2unicode.sh
-rwxr-xr-xansi2unicode.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/ansi2unicode.sh b/ansi2unicode.sh
new file mode 100755
index 0000000..246530e
--- /dev/null
+++ b/ansi2unicode.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Convert code page ANSI file to UTF-16 LE
+#
+
+_=$(basename $0)
+
+if [ -z "$1" ] ; then
+ echo $_ : usage $_ file ...
+ exit 1
+fi
+
+FROM=CP1252
+TO=UTF-16LE
+
+for i in $@ ; do
+ TMP="$i.$$"
+ iconv -f $FROM -t $TO "$i" > "$TMP"
+ mv "$TMP" "$i"
+done