it doesn't make sense to add try/catch every time you use tolower/toupper/foreach on string. No one will do that. You either throw exception when convert invalid utf8 bytes to string, or never throw exception and use invalid UTF32 code in dchar to represent invalid utf8 code.
string s = "\x0A"; // this is the right place to throw the exception (or compile error) s.tolower; // no one will add try/catch on this --ZY Zhou == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > On 3/13/11 1:55 PM, Jacob Carlborg wrote: > > I would say that the functions should NOT crash but instead throw an > > exception. Then the developer can choose what to do when there's an > > invalid unicode character. > Yah. In addition, the exception should provide index information such > that an application can elect to continue processing. > Andrei