[Python-Dev] Unicode and Windows

Greg Stein gstein@lyra.org
Fri, 24 Mar 2000 02:54:02 -0800 (PST)


On Fri, 24 Mar 2000, M.-A. Lemburg wrote:
>...
>   "s":  For Unicode objects: auto convert them to the <default encoding>
>         and return a pointer to the object's <defencstr> buffer.

Guess that I didn't notice this before, but it seems wierd that "s" and
"s#" return different encodings.

Why?

>   "es": 
> 	Takes two parameters: encoding (const char **) and
> 	buffer (char **). 
>...
>   "es#":
> 	Takes three parameters: encoding (const char **),
> 	buffer (char **) and buffer_len (int *).

I see no reason to make the encoding (const char **) rather than
(const char *). We are never returning a value, so this just makes it
harder to pass the encoding into ParseTuple.

There is precedent for passing in single-ref pointers. For example:

  PyArg_ParseTuple(args, "O!", &s, PyString_Type)


I would recommend using just one pointer level for the encoding.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/