The Case Against Autodecode
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 2 14:20:33 PDT 2016
On Thursday, 2 June 2016 at 20:13:52 UTC, Andrei Alexandrescu
wrote:
> On 06/02/2016 03:34 PM, deadalnix wrote:
>> On Thursday, 2 June 2016 at 19:05:44 UTC, Andrei Alexandrescu
>> wrote:
>>> Pretty much everything. Consider s and s1 string variables
>>> with
>>> possibly different encodings (UTF8/UTF16).
>>>
>>> * s.all!(c => c == 'ö') works only with autodecoding. It
>>> returns
>>> always false without.
>>>
>>
>> False.
>
> True. "Are all code points equal to this one?" -- Andrei
The good thing when you define works by whatever it does right
now, it is that everything always works and there are literally
never any bug. The bad thing is that this is a completely useless
definition of work.
The sample code won't count the instance of the grapheme 'ö' as
some of its encoding won't be counted, which definitively count
as doesn't work.
When your point need to redefine words in ways that nobody agree
with, it is time to admit the point is bogus.
More information about the Digitalmars-d
mailing list