Re: [AD] unicode proposal |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2009-01-20, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> 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.
I basically agree with your function lists.
Later, I think I'd like to introduce explicit iterator types rather than
bare pointers for ugetx (and give it a better name). Also if sticking
with UTF-8 (or even UTF-16) there's no reason not to introduce backwards
traversal.
The API is prone to buffer overflows and arbitrarily truncated strings
due to the use of preallocated buffers. Probably the solution is
dynamic allocation.
> _ustrdup (we should add a strdup entry to
> al_set_memory_management_functions and Allegro should use that instead
> of strdup everywhere)
It should just use the malloc replacement.
> 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.
An ISO-8859-1 converter could stay as it's purely a re-encoding.
Peter