$ perl -we 'binmode STDOUT, ":encoding(UTF-16LE)"; print "AB"'|hexdump -C 00000000 41 00 42 00 |A.B.|