Character is only first byte of an UTF-8 sequence

Længlich nospam at void.invalid
Sat Sep 8 11:31:29 PDT 2007


Hi,

> If different characters are all coming out as 195, with no bytes in between 
> to distinguish them, then it's definitely a bug in DFL.

No, it was just because of my misunderstanding of what a »char« is in D. Now that I know that char[] is much like a byte array and not really like a string in other languages, I see that no data is lost.
Obviously I just couldn't get the second byte, because it always throwed an exception in my context. But the problem is solved now.

My program has to deal with input in arbitrary languages; I want every possible character to work fine (even those from higher planes). So I now use dchar for all my functions, and since this change everything works as desired.

Thanks to all of you!

Kindest regards,
Længlich



More information about the Digitalmars-d mailing list