www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12324] New: std.uni.Grapheme / byGrapheme can't search for decomposed form

https://d.puremagic.com/issues/show_bug.cgi?id=12324

           Summary: std.uni.Grapheme / byGrapheme can't search for
                    decomposed form
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com



00:58:49 EET ---
import std.uni;
import std.algorithm;

void main()
{
    auto s = "casse\u0301"; // "é" ("e" + combining diacritic)
    assert(s.byGrapheme.canFind(Grapheme("\u00e9"))); // "é"
}

If you print Grapheme("\u00e9") and the last grapheme in s, many of the fields
appear to be different:

Grapheme(1000065, 3, 0, 33554432, [101, 0, 0, 1, 3, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0], 2) // last byGrapheme

vs.

Grapheme(E9, 0, 0, 16777216, [233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0], 1) // Grapheme("é")

http://forum.dlang.org/post/mwunfkwzcmmxtjmahlck forum.dlang.org

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 08 2014