#!/usr/bin/perl -w binmode STDOUT, ":encoding(utf16)"; while (<>) { print; } #### $ export PERLIO=:utf8 $ myscript *.utf8 ## works the same as: cat *.utf8 | myscript