Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function 2utf8(){
- local tmp=$(mktemp)
- local charset="$(file -bi "$1"|awk -F "=" '{print $2}')"
- if [ "$charset" != "utf-8" ]; then
- iconv -f "$charset" -t utf8 "$1" -o $tmp
- mv "$tmp" "$1"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement