On Sunday, August 26, 2018 7:25:12 PM MDT Neia Neutuladh via Digitalmars-d wrote: > > Can I just throw in here that I like autodecoding and I think > > it's good? > > If you want ranges that iterate over bytes, then just use > > arrays of bytes. If you want Latin1 text, use Latin1 strings. > > If you want Unicode, you get Unicode iteration. This seems > > right and proper to me. Hell I'd love if the language was > > *more* aggressive about validating casts to strings. > > Same here. I do make unicode errors more often than I'd care to > admit (someString[$-1] being the most common; I need to write a > lastChar helper function), but autodecoding means I can avoid > that class of errors.
Except that it doesn't really. It just makes it so that you make those errors at the code point level instead of at the code unit level, where the error is less obvious, because it works correctly for more characters. But it's still wrong in general. e.g. code using auto-decoding is generally going to be horribly broken when operating on Hebrew text because of all of the combining characters that get used there. - Jonathan M Davis