logo       

Unicode strings: msg#00222

python.c++

Subject: Unicode strings

Hi,

Is it possible to convert a python unicode object to a C++ string object?
If yes: How do I do that?
If no: Would it be possible to include unicode support into the string wrapper class in Boost.Python?

Thanks,
Andreas


PS: Apperently the following does not work:

class my_class
{
...
void take_a_string(string);
...
}

Then in the wrapper:
.def("take_a_string", &my_class::take_a_string)

And finally in Python:
>>> x = my_class()
>>> x.take_a_string(unicode("something"))

-> TypeError


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise