[Python-Dev] Unicode and Windows

Jack Jansen jack@oratrix.nl
Wed, 22 Mar 2000 14:46:50 +0100


> > [on the user-supplies-buffer interface]
> > I think this would be much less error-prone than having fixed-length buffers
> > all over the place.
> 
> PyArg_ParseTuple() should probably raise an error in case the
> data doesn't fit into the buffer.

Ah, that's right, that solves most of that problem.

> > [on the malloced interface]
> Good point. You'll still need the buffer_len output parameter
> though -- otherwise you wouldn't be able tell the size of the
> allocated buffer (the returned data may not be terminated).

Are you sure? I would expect the "eS" format to be used to obtain 8-bit data 
in some local encoding, and I would expect that all 8-bit encodings of unicode 
data would still allow for null-termination. Or are there 8-bit encodings out 
there where a zero byte is normal occurrence and where it can't be used as 
terminator?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm