http://d.puremagic.com/issues/show_bug.cgi?id=8890

           Summary: std.algorithm.commonPrefix does not handle unicode
                    correctly
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-10-24 21:31:11 
PDT ---
This code asserts:

import std.algorithm;

void main()
{
    assert(commonPrefix("Пиво", "Пони")== "П");
}

This is because a portion of the code point following 'П' is returned, because
the code units at the beginning of the next code point match, and commonPrefix
fails to take that possibility into account. It basically operates on code
units right now for matching string types rather than operating on code points
as it should.

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

Reply via email to