www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23341] New: [std.uni] ZWJ not handled properly

https://issues.dlang.org/show_bug.cgi?id=23341

          Issue ID: 23341
           Summary: [std.uni] ZWJ not handled properly
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/phobos/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: garrett damore.org

For example, when iterating over the following string "\U0001f9db\u200d\u2640"
byGrapheme, there should be exactly one grapheme (representing a female
vampire). Instead it is treated as two graphemes.

This form of composition is becoming increasingly important in modern Unicode,
as it is used to build rich representations of characters, for example adding
or modifying gender.

An example program demonstrating this problem is here:

https://gist.github.com/gdamore/13cc3b50aa3dbffca291f76b87849645

Note that in some systems, fallbacks may actually render these "graphemes" as
multiple glyphs (Unicode TR51 leaves this as an implementation detail), so we
might want to have a way to specify whether these are displayed together or
separately.

Modern implementations can generally display quite a high level of richness
without needing fallbacks.

--
Sep 17 2022