Perl : How to print all cp1252 characters on by one ?

Posted by Vinay on Stack Overflow See other posts from Stack Overflow or by Vinay
Published on 2010-06-03T08:58:54Z Indexed on 2010/06/03 9:04 UTC
Read the original article Hit count: 166

Filed under:

Hi,i am not able to write a script to print all the latin -1 characters one by one.Can anybody help me in solving the problem?

I am using the below code but it is not giving me expected result.

foreach $char(0..255) {
$hexval = sprintf("%x",$char);
$charval = sprintf("%c",%hexval);
print "$charval"; }

output should be like :-

0065 - e
0066 - f
...
...
007F - character at the step

For all the codepoints after 007F,it is not giving me expected results.

Please help me out with this

© Stack Overflow or respective owner

Related posts about perl