On 5/29/2014 11:25 AM, Dmitry Olshansky wrote:
Agreed. The simple dream of automatically decoding UTF and staying "Unicode correct" is a failure.
Yes. Attempting to hide the fact that strings are UTF-8 is just doomed. It's like trying to pretend that floating point does not do rounding.
It's far more practical to embrace what it is and deal with it. Yes, D programmers will need to understand what UTF-8 is. I don't see any way around that.
My proposal for dealing with this, while retaining backwards compatibility, is adding the ranges byCodeunit, byChar, byWchar and byDchar which can be applied to any string arrays or string ranges.