string need to be robust

ZY Zhou rinick at GeeMail.com
Sun Mar 13 04:34:24 PDT 2011


std.utf throw exception instead of crash the program. but you still need to add
try/catch everywhere.

My point is: this simple code should work, instead of crash, it is supposed to
leave all invalid codes untouched and just process the valid parts.

Stream file = new BufferedFile("sample.txt");
foreach(char[] line; file) {
   string s = line.idup.tolower;
}



More information about the Digitalmars-d mailing list