Re: Obsolete fribidi_log2vis
Shachar Shemesh <[email protected]> Tue, 23 Jun 2009 19:26:22 +0300
| Newsgroups | gmane.comp.internationalization.fribidi |
|---|---|
| Message-ID | <[email protected]> |
أحمد المحمودي wrote: > Hello, >> Are you looking for the string size in characters or in bytes? >> > ---end quoted text--- > > Anyone of them is fine. > > Then allocate enough storage (character count * 4 ought to be enough), do the reordering + shaping, and then use strlen. That will give you number of bytes. Yes, if you need precise storage, you may need to copy the string again after that, but there is little that can be done about that. There is no way to know how much memory will be needed without actually performing the operations, so the only way to do this without temporary storage is to do it twice. This, typically, costs more than using temporary storage. Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com _______________________________________________ fribidi mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/fribidi