$ perl -lnE 'BEGIN { eof(); binmode ARGV, ":encoding(cp936)";} say' a.txt b.txt