in reply to Freecell Dealer

You could also insert this somewhere in your program:

my $cp; BEGIN { ($cp) = `chcp & chcp 65001` =~ /(\d+)/ if $^O eq 'MSWin32' } END { `chcp $cp` if $^O eq 'MSWin32' }