[AD] ucwidth_max()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,
Here is a patch that adds ucwidth_max(), which returns the maximum number
of bytes that a character can occupy in a given text encoding format. I
find it quite useful because my add-on library wants to allocate memory for
a given number of characters in an edit box. It's just a suggestion, and I
haven't asked any guru if it is a wanted feature, so add it if you want to.

I'm not sure I made the code the way that Shawn would want it, so let me
know if it should be rearranged in some way. Also, I'm not 100% sure that
the max width of an UTF-8 character is 8 bytes so it would be good if
someone could confirm this.

Sven

Attachment: ucwidth_max.zip
Description: Zip archive







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/