summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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