perl -pe' BEGIN { binmode(STDIN, ":encoding(XXX)"); binmode(STDOUT, ":encoding(UTF-8)"); } < file.XXX > file.utf-8 '