mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-03 01:30:43 +00:00
16 lines
311 B
Bash
Executable File
16 lines
311 B
Bash
Executable File
#!/bin/bash
|
|
TO="UTF-8"; FILE=$1
|
|
FROM=$(file -i $FILE | cut -d'=' -f2)
|
|
if [[ $FROM = "binary" ]]; then
|
|
echo "Skipping binary $FILE..."
|
|
exit 0
|
|
fi
|
|
iconv -f $FROM -t $TO -o $FILE.tmp $FILE; ERROR=$?
|
|
if [[ $ERROR -eq 0 ]]; then
|
|
echo "Converting $FILE..."
|
|
mv -f $FILE.tmp $FILE
|
|
else
|
|
echo "Error on $FILE"
|
|
fi
|
|
|