Re: [AD] unicode proposal

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


On Sun, 2009-01-25 at 10:00 +1100, Peter Wang wrote:
> 
> I've played with it now, and it's nice.
> 
> I think we should finally introduce a new type for Unicode string
> manipulation which performs dynamic memory allocation.  I've started on
> one which uses bstring for its storage.  It's attached (work in
> progress).

Ah, good thing we changed the license, now we actually can do things
like include non-public-domain code with a compatible license.

And I agree. Since we will have yet another string manipulation API
anyway, better have a sane one instead of those u* wrappers around libc.
Likely converting to your API will fix some hidden bugs like possible
buffer overflows even in our own code (when I added the
al_path_set_extension function recently it took me quite some time to
get it right :P), and even more so in user code using the u* functions.

> The idea is that you produce an ALLEGRO_USTR from a char* or afresh,
> manipulate it, then get back a char* for printing out or whatever.
> Outside of the string functions themselves, Allegro functions would
> *not* take ALLEGRO_USTR arguments. Strings should still be char* so you
> can give them C literals or use other another string APIs as you like.
> 

I only looked at the ex_ustr code, and I like it. And yes, we always
should keep in mind the upcoming C++ and D and other wrappers, which of
course would not expose this API - it's only for our internal use and
for use in C code.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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