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

           Summary: Example code for std.utf.toUTFindex does not work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Kenji Hara <[email protected]> 2013-07-30 18:58:50 PDT ---
As the title.

import std.utf;
void main()
{
  assert(toUTFindex(`hello world`, 7) == 7);    // doesn't work!
  assert(toUTFindex(`hello world`w, 7) == 7);
  assert(toUTFindex(`hello world`d, 7) == 7);

  assert(toUTFindex(`Ma Chérie`, 6) == 7);      // doesn't work!
  assert(toUTFindex(`Ma Chérie`w, 7) == 7);
  assert(toUTFindex(`Ma Chérie`d, 7) == 7);

  assert(toUTFindex(`さいごの果実 / ミツバチと科学者`, 3) == 9);  // doesn't work!
  assert(toUTFindex(`さいごの果実 / ミツバチと科学者`w, 9) == 9);
  assert(toUTFindex(`さいごの果実 / ミツバチと科学者`d, 9) == 9);
}

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

Reply via email to