Safer casts

Janice Caron caron800 at googlemail.com
Sat May 10 04:43:54 PDT 2008


On 10/05/2008, Janice Caron <caron800 at googlemail.com> wrote:
> You are incorrect. Indisputably, typeof(t) == invariant(char)[]. It is
>  an array of invariant chars - that is, an array of invariant UTF-8
>  code units. Each code unit is individually valid, but the complete
>  string consists of two malformed code unit sequences, each of which is
>  an isolated continuation byte.

My apologies. The complete string consists of /one/ malformed code
unit sequence, consisting of one isolated continuation byte, not two.
For some reason I misread s[1..2] as s[1..3] (which is pretty dumb
really, seeing as I wrote it). :-)


>  If you want to talk Unicode, I'm happy to do so, but please
>  let's take that to another thread.

This still stands.



More information about the Digitalmars-d mailing list