develooper Front page | perl.perl6.users | Postings from July 2018

can't match unicode chars?

Thread Next
From:
Marc Chantreux
Date:
July 31, 2018 19:36
Subject:
can't match unicode chars?
Message ID:
20180731192808.GA7740@prometheus.u-strasbg.fr
hello people,

given the slides of my talk in the slides.vim format
(https://github.com/eiro/slides.vim), i want some of
them to be shown one bullet a slide. so when i have
this input:

    › Renater et le libre

         Sympa
         FileSender

the desired output is:

    › Renater et le libre

         Sympa
    › Renater et le libre

         FileSender

and it seems gather is the perfect solution for that so i started to
write it (any golfer magic or other feedback warmly welcome):

@*ARGS.map: {
    gather {
        my @lines;
        for .IO.lines -> $l {
           if /'›'/ {
               @lines and take @lines;
               @lines = $l;
           }
           else {
               @lines.push($l);
               take @lines if /''/;
           }
        }
    }
}

this doesn't work as it seems that '›' and '' aren't matched.
i tried both

    for .IO.lines -> $l {

    # following https://docs.perl6.org/routine/lines#class_IO::Path
    for .IO.lines(enc => 'utf8') -> $l {

but none of them worked and i run out of idea to know what's going on.

any idea or documentation point for me ?
regards

marc

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About