String implementations

Jarrod qwerty at ytre.wq
Sat Jan 19 18:03:21 PST 2008


On Sat, 19 Jan 2008 20:21:49 +0000, Janice Caron wrote:

> So you're saying that in your new design, after that assignment, a would
> equal "\u20ACbcd". The problem is that the compiler would have to
> allocate extra bytes and then memcpy all the bytes up a bit to make
> room. That strikes me as kinda slow, which is not something I'd want in
> a char array.

Well how else would you like it to be done? 
If you were writing something that took a text input much like this very 
window I'm typing in right now, and the user hit back a few times and 
input a multi-byte character, how would you deal with it? Allow it to 
overlap? No. dchars? That's a lot of wasted memory, and it basically 
makes me wonder why utf-8 even exists if it needs to be dropped for 
simple text manipulation. May as well stick with utf-32 and ascii.

No sir, I don't like it.



More information about the Digitalmars-d mailing list