[FriBidi] Obsolete fribidi_log2vis

Shachar Shemesh shachar at shemesh.biz
Tue Jun 23 09:26:22 PDT 2009


أحمد المحمودي 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/fribidi/attachments/20090623/8527866f/attachment.html 


More information about the fribidi mailing list