Re: [Cython] [Pyrex] Python 3
Greg Ewing <greg.ewing-F+z8Qja7x9Xokq/[email protected]>
| Newsgroups | gmane.comp.python.cython.devel,gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Christian Heimes wrote: > In Python 3.x the PyUnicode object keeps a default encoded PyString in > its struct. You can use PyUnicode_AsStringAndSize() to get an UTF8 > encoded char* from a PyUnicode object without worrying about memory > management. Thanks, I didn't know that. So it seems that we could, if it were considered desirable, have an automatic cast from unicode to char *. But the encoding would *have* to be utf8 -- anything else would require memory allocation. -- Greg