The Case Against Autodecode

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 2 12:43:36 PDT 2016


On 02.06.2016 21:26, Andrei Alexandrescu wrote:
> ag0aep6g <anonymous at example.com> wrote:
>> On 06/02/2016 09:05 PM, 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.
>>
>> Doesn't work with autodecoding (to code points) when a combining
>> diaeresis (U+0308) is used in s.
>
> Works if s is normalized appropriately. No?
>

No. assert(!"ö̶".normalize!NFC.any!(c => c== 'ö'));


More information about the Digitalmars-d mailing list