$ perl -e 'print "a\x{2322}bcd\n"' > uni-file $ perl -ne 'print substr($_,0,3), "\n"' uni-file | hexdump 00000000 61 e2 8c 0a