Re: UT_UCS2String problems


Subject: Re: UT_UCS2String problems
From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Fri Jun 01 2001 - 12:31:35 CDT


Joaquin Cuenca Abela wrote:
>
> --- Andrew Dunbar <hippietrail@yahoo.com> wrote:
> >
> > Also the size() method is now ambiguous. Does it
> > return the
> > number of characters or the number of bytes?
> > Shouldn't we
> > have two non-ambiguous methods in both the UT_String
> > and
> > UT_UCS2String?
>
> I don't think so. To me size() should return the
> number of "entries" in the string. And here, the type
> of the "entries" are "char", or "wchar_t", or
> whatever. So size should return the number of
> characters.

For a vector or an array I'd agree but a string is a
bit different. I'll change my code to
write(pString->ucs_str(), pString->size * sizeof(UT_UCSChar));

Have you checked the corruptions problems by the way?

Andrew.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



This archive was generated by hypermail 2b25 : Fri Jun 01 2001 - 12:29:52 CDT