Why is string.front dchar?

Timon Gehr timon.gehr at gmx.ch
Thu Jan 23 02:25:39 PST 2014


On 01/23/2014 02:39 AM, Jakob Ovrum wrote:
> On Thursday, 23 January 2014 at 01:17:19 UTC, Timon Gehr wrote:
>> On 01/16/2014 06:56 AM, Jakob Ovrum wrote:
>>>
>>> Note that the Unicode definition of an unqualified "character" is the
>>> translation of a code *point*, which is very different from a *glyph*,
>>> which is what people generally associate the word "character" with.
>>> Thus, `string` is not an array of characters (i.e. an array where each
>>> element is a character), but `dstring` can be said to be.
>>
>> A character can be made of more than one dchar. (There are also more
>> exotic examples, eg. IIRC there are cases where three dchars make
>> approximately two characters.)
>
> No, I believe you are thinking of graphemes.

Sure. Their existence means it is in general wrong to think of a dchar 
as one character.


More information about the Digitalmars-d-learn mailing list