Download this file
18 lines (16 with data), 472 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
|
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.