#!/usr/bin/perl -- use strict; use warnings; binmode STDOUT, ':encoding(UTF-8)'; my( $chcp ) = (`chcp`) =~ /(\d+)/; $chcp and qx!chcp 65001!; #now UTF-8 print "Hello, printing chr 900..950\n"; $|=1; for(900..950){ print $_, ' ',chr($_), ' '; print "\n" if 0 == $_ % 6; } $chcp and `chcp $chcp`; # restore original __END__