Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ehrenfeu/7bcbc1022336e764b706 to your computer and use it in GitHub Desktop.
Save ehrenfeu/7bcbc1022336e764b706 to your computer and use it in GitHub Desktop.
Fix filenames encoded in 437 to UTF-8.
#!/bin/bash
#
test -z "$1" && exit 1
# echo "$1"
FIXED=$(echo "$1" | iconv -f 437 -t utf8)
# echo "$FIXED"
if ! [ "$1" == "$FIXED" ] ; then
mv -v "$1" "$FIXED"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment