#!/bin/zsh # rubikon - an end to latin files autoload zmv [[ $1 = -f ]] || OPT=-n # convert latin1 to utf8, but never double encode. i2u() { new=$(iconv -f UTF-8 -t UTF8 <<<$1 2>/dev/null) || new=$(iconv -f ISO8859-1 -t UTF8 <<<$1 2>/dev/null) printf "%s" $new } zmv $OPT '(**/)(*)' '$(i2u $1$2)'