Summary: std.algorithm.commonPrefix does not handle unicode
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Jonathan M Davis <> 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:
------- You are receiving this mail because: -------

Reply via email to