[Python-3000] C API cleanup str

Guido van Rossum guido at python.org
Sun Aug 5 17:08:28 CEST 2007


On 8/5/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > Aside from the name, are there other issues you can think of with any
> > of the API changes?  There are some small changes, things like macros
> > only having a function form.  Are these a problem?
> >
> > Str/unicode is going to be a big change.  Any thoughts there?
>
> We need some rules on what the character set is on the C level.
> E.g. if you do PyString_FromStringAndSize, is that ASCII, Latin-1,
> UTF-8? Likewise, what is the encoding in PyArg_ParseTuple for s
> and s# parameters?

IMO at the C level all conversions between bytes and Unicode that
don't specify a conversion should use UTF-8. That's what most of the
changes made so far do.

An exception should be made for stuff that explicitly handles
filenames; there the filesystem encoding should obviously used.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list