The examples do not show forward-looking combiners.
Not sure what's happening with the ZWJ - I dimly recall that Unicode says it is a misnomer and explicitly does not join arbitrary graphemes into characters, but I don't have the reference handy.

Aleks-Daniel is showing that x 2 does not detect the situation when concatenation places a combining mark behind a base character, which should be turned into a single grapheme.
And that ~ does detect the combination.

Am 26.07.2017 um 18:33 schrieb Brandon Allbery:
Combining chars look forward now? This breaks *my* expectations.

On Wed, Jul 26, 2017 at 6:36 AM, Aleks-Daniel Jakimenko-Aleksejev <perl6-bugs-follo...@perl.org <mailto:perl6-bugs-follo...@perl.org>> wrote:

    # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
    # Please include the string:  [perl #131801]
    # in the subject line of all future correspondence about this issue.
    # <URL: https://rt.perl.org/Ticket/Display.html?id=131801
    <https://rt.perl.org/Ticket/Display.html?id=131801> >


    Code:
    say (“\c[COMBINING OVERLINE]a” x 2).chars

    Result:
    4


    Code:
    say (“\c[COMBINING OVERLINE]a” ~ “\c[COMBINING OVERLINE]a”).chars

    Result:
    3



    Both should produce the same result (3). What happens here is “a” on
    one side is not being squished into one grapheme with a combiner on
    another side.

    Please note that combiners are not the only thing can cause this.
    Here is the same thing with ZWJ:

    Code:
    my $x = “\x[2695]\x[FE0F]a\x[1F468]\x[200D]”;
    say ($x ~ $x).chars;
    say ($x x 2).chars


    Result:
    5
    6




    I have a feeling that this is a known issue, and that there might be
    a ticket for this already. However, I couldn't find it.




--
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com <mailto:allber...@gmail.com> ballb...@sinenomine.net <mailto:ballb...@sinenomine.net>
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Reply via email to