Thread overview
[Issue 10732] New: Example code for std.utf.toUTFindex does not work
Jul 31, 2013
Kenji Hara
Jul 31, 2013
Kenji Hara
Aug 01, 2013
Kenji Hara
July 31, 2013
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: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 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: -------
July 31, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10732


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-07-30 19:13:37 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1443

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 01, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10732



--- Comment #2 from github-bugzilla@puremagic.com 2013-07-31 17:15:44 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/a5ee921f7d2f327e82316de05814ffebda89e201 fix Issue 10732 - Example code for std.utf.toUTFindex does not work

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 01, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10732


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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