[C++-sig] Working with python unicode strings without wstring

Markus Heller markus at relix.de
Sun Aug 6 01:58:12 CEST 2006


Dear Roman,

> > > May be you should use another set of API?
> > > http://docs.python.org/api/unicodeObjects.html

well, I have done some experiments with the API you're suggesting. Though, I 
have a number of problems here:

I see that Py_UNICODE refers to one single character / symbol which may be any 
symbol whatsoever in its numeric representation. 

I see that when I retrieve my unicoded Python string with 

PyContainer = PyList_GetItem(Tuple, 1);

and when I convert the PyObject "PyContainer" into a PyUnicodeObject, I do it 
with a simple cast, which works fine. Then, I'd like to get hold of the 
individual symbols, also in their numeric (not encoded) representation. But 
how can I do this? Initially, I wanted to get everything into the form of a 
stl string, but a stl vector will also do fine. 

Thanks very much for your help!

Markus




More information about the Cplusplus-sig mailing list