Revision f1f97699cb5e01f1b7e37f4c92df1a9bce6772f5 authored by Kurt Cancemi on 22 September 2016, 22:05:37 UTC, committed by Matt Caswell on 11 October 2016, 18:22:28 UTC
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
1 parent 53a71b7
toutf8.sh
#! /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

Computing file changes ...