If invalid string should crash(was:string need to be robust)

%u a at aaa.com
Sun Mar 13 19:18:06 PDT 2011


> But for the following case, it is complete wrong if it crash at line 3:
>  1:  char[] c = [0xA0];
>  2:  string s = c.idup;
>  3:  foreach(dchar d; s){}
> The expected result is either:
>  a) crash at line 2, c is not valid utf and can't be converted to string
> or:
>  b) don't crash, and d = 0xDCA0;

I agree with a), but not b), Can't find anything in unicode standard says you can
use the low surrogate like that



More information about the Digitalmars-d mailing list