use open qw(:std :utf8); OR #### binmode STDIN, ":encoding(UTF-8)"; #### binmode STDIN, ":encoding(UTF-16)"; #OR binmode STDIN, ":encoding(cp1252)";