www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12923] New: UTF exception in stride even though passes

https://issues.dlang.org/show_bug.cgi?id=12923

          Issue ID: 12923
           Summary: UTF exception in stride even though passes validate.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: timothee.cour2 gmail.com

import std.utf;
void main(){
  char[3]a=[167, 133, 175];
  validate(a);
  //passes

  auto k=stride(a,0);
  /+
  std.utf.UTFException std/utf.d(199): Invalid UTF-8 sequence (at index 0)
  pure  safe uint std.utf.stride!(char[3]).stride(ref char[3], ulong) + 141
  +/
}

This happens even after applying the fix
https://github.com/D-Programming-Language/phobos/pull/2038

--
Jun 14 2014