[AD] unicode proposal

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


The topic was brought up a few times already, but at some point we
should decide what to do about unicode functions in A5.

An easy solution would be to assume that any strings passed to Allegro
functions are encoded in UTF8 (that includes all 7-bit ASCII strings).
Then prefix some of the A4 unicode functions with al_ so users aren't
completely left in the dark when they have to deal with non-ASCII
strings.

A4 function descriptions are here:
http://www.liballeg.org/stabledocs/en//alleg002.html

Functions I guess are useful and simple enough to keep, as al_ prefixed
versions:

al_ucwidth
al_ugetat
al_ugetc
al_ugetx
al_ugetxc
al_uinsert
al_uoffset
al_uremove
al_usetat
al_usetc
al_usprintf
al_ustrchr
al_ustrcmp 
al_ustrlen 
al_ustrncat
al_ustrncmp
al_ustrncpy
al_ustrpbrk (maybe remove this one since I can't pronounce it?)
al_ustrrchr
al_ustrsize
al_ustrsizez
al_ustrstr
al_ustrtok (maybe remove this one and rename the one below?)
al_ustrtok_r
al_ustrzcat 
al_ustrzcpy
al_ustrzncat
al_ustrzncpy
al_uszprintf
al_uvsprintf
al_uvszprintf
al_uwidth

Functions which are not needed because they are identical for ASCII and
UTF8, but which we might keep as prefixed aliases anyway: 

ustrcat
ustrcpy
ustrdup

Functions I think are too hard to implement correctly (in all cases I
can think of, the libc functions will work more or less if you pass UTF8
to them anyway):

uatof
uisdigit
uisspace
ustricmp
ustrlwr
ustrnicmp
ustrtod
ustrtol
ustrupr
utolower
utoupper

Functions I guess are no longer needed if we only support UTF8: 

do_uconvert
empty_string
get_uformat
need_uconvert
register_uformat
set_ucodepage
set_uformat
uconvert
uconvert_ascii
uconvert_size
uconvert_toascii
uisok 
uwidth_max
_ustrdup (we should add a strdup entry to
al_set_memory_management_functions and Allegro should use that instead
of strdup everywhere) 

The conversion functions likely can be useful internally in the
filesystem code - but the user should not have to deal with anything but
UTF8 when using A5's filesystem layer.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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