in reply to Generating a range of Unicode characters

Is this what you're after?

perl -CSD -le 'print chr for 0xDF .. 0x0101'

Update: I hadn't read all the way down davido's post. He is making the same suggestion already at the end.

Replies are listed 'Best First'.
Re^2: Generating a range of Unicode characters
by davido (Cardinal) on Nov 16, 2017 at 06:21 UTC

    You have been upvoted: I took way too long to get to the point. ;)


    Dave

      Thanks, both of you. The following produces the output I am expecting.

      perl -e '$a=join("",map ({chr} 0xdf .. 0x0101)); print "$a\n";'

      I guess there is no way to do the Unicode equivalent of 'A' .. 'Z' instead.

      Is there some way to skip the map() or chr() functions?

        Is there some way to skip the map() or chr() functions?

        Why would you want to skip them? Any why them but not join? Seems rather arbitrary.

        You'll need chr however you go about this and it is not a difficult fuction to understand. map can be avoided but you'll still need some sort of iterative/looping structure. eg:

        perl -e 'print chr for 0xdf .. 0x0101, 0xa';

        That's with *nix EOL.

        Is there some way to skip the map() or chr() functions?
        Probably not. The 0xdf .. 0x0101 construct is just a range of numbers, you need, one way or another, to convert these numbers into characters.

      :P My short attention span cannot excuse me. You covered all the bases quite nicely, as usual. I was reading on my phone though, if that is a mitigating factor.