On 10 Jun 2013, at 08:57, Luboš Doležel <address@hidden> wrote:
On Mon, 10 Jun 2013 07:58:29 +0100, Richard Frith-Macdonald wrote:
1) it fails if the output buffer is too small - we don't want that
in this case
Well, that depends on what arguments you pass to it ... if you
provide it with a zone in which to allocate memory, it will
allocate
memory to make a bigger output buffer if necesary.
Not quite. The caller of getBytes supplies his own buffer.
Should the buffer not be sufficient and GSFromUnicode() allocates
own memory, I'd then have trouble finding out how many bytes to copy
to caller's buffer *without* splitting an UTF-8 character in the
middle (for example).
So there is no problem with memopry allocation ... if you want
GSFromUnicode() to allocate more memory, you can tell it to do that,
and if you don't want it to, you can tell it to do that too.