aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/util/toutf8.sh
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/util/toutf8.sh')
-rwxr-xr-xcrypto/openssl/util/toutf8.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/openssl/util/toutf8.sh b/crypto/openssl/util/toutf8.sh
new file mode 100755
index 000000000000..8a4254b3df3d
--- /dev/null
+++ b/crypto/openssl/util/toutf8.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# Very simple script to detect and convert files that we want to re-encode to UTF8
+
+git ls-tree -r --name-only HEAD | \
+ while read F; do
+ charset=`file -bi "$F" | sed -e 's|.*charset=||'`
+ if [ "$charset" != "utf-8" -a "$charset" != "binary" -a "$charset" != "us-ascii" ]; then
+ iconv -f ISO-8859-1 -t UTF8 < "$F" > "$F.utf8" && \
+ ( cmp -s "$F" "$F.utf8" || \
+ ( echo "$F"
+ mv "$F" "$F.iso-8859-1"
+ mv "$F.utf8" "$F"
+ )
+ )
+ fi
+ done