Should you be able to initialize a float with a char?

kdevel kdevel at vogtner.de
Fri May 20 00:50:06 UTC 2022


On Thursday, 19 May 2022 at 23:26:57 UTC, deadalnix wrote:
>>>>    input            : A Ä
>>>>    bright           : a Ä <-- upper case
>>>>    toLower (std.utf): a ä
>>>>    input            : A Ä
>>>>    bright           : a ä
>>>>    toLower (std.utf): a ä <-- lower case
>>>>
>>>> See the problem?
>>>
>>> You could have use "Ali Çehreli" as a test case :)
>>
>> One needs to combine U+0043 LATIN CAPITAL LETTER C + U+0327 
>> COMBINING CEDILLA in this case. Further Reading:
>>
>> [3] 
>> https://medium.com/@sthadewald/the-utf-8-hell-of-mac-osx-feef5ea42407
>
> This, or simply U+00E7 .

Not "or" but "and". The first input contains UTF-8 of the 
(normalized) codepoint, which is left unchanged by Walters 
lowercase function. The second input contains UTF-8 of the same 
codepoint in canonically decomposed form (NFD).

> Which will cause a similar problem as the one you raised.

The problem is that you cannot decide only from the value of a 
single UTF-8 codeunit (char) if it stands for an ASCII character 
in the string.


More information about the Digitalmars-d mailing list