Please close this, I was being an idiot. \c[0x2424] - I just blithely assumed that the number was as in \x{..}.

On 2016-01-09 10:33, perl6 via RT wrote:
Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
        "Potential regular expression issue",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #127220].

Please include the string:

         [perl #127220]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                        Thank you,
                        perl6-bugs-follo...@perl.org

-------------------------------------------------------------------------
jgoff@Demeisen:~$ perl6 -v
This is Rakudo version 2015.12-152-gd7f3f0b built on MoarVM version
2015.12-29-g8079ca5
implementing Perl 6.c.

The following is a simple script that changes newlines to their control
picture equivalent, or at least it should:

--cut here--
my $str = "foo\nbar";
$str ~~ s:g/\n/\c[2424]/;
say $str;
--cut here--

And here's the output:

--cut here--
jgoff@Demeisen:~$ perl6 -I. bug.txt | hexdump -C
00000000 66 6f 6f e0 a5 b8 62 61 72 0a |foo...bar.|
0000000a
--cut here--

The s/// statement turns newlines into E0 A5 B8, which is U+0978
DEVANAGARI LETTER MARWARI DDA and not E2 90 A4, which is U+2424 SYMBOL
FOR NEWLINE. The 0A at the end of the string is unaffected, as it should
be.

Reply via email to