where is the PyString_AsString in Python 3.0?

Benjamin Peterson benjamin at python.org
Fri Mar 6 20:50:47 CET 2009


BigHand <heweiwei <at> gmail.com> writes:
> > There is no PyString_AsString. Everything
>> string is unicode now. (PyUnicode API)
> hello,Ben,
> could you give me an example? I almost know the
> PyUnicode API,but the
> docs of 3.0 is too brief for me.

PyString_FromString -> PyUnicode_FromString
PyString_Concat -> PyUnicode_Concat
etc...

To get a char * you have to explicitly encode the string with
PyUnicode_AsEncodedString.







More information about the Python-list mailing list