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

Rod Cloutier rodlist at hotmail.com
Mon May 1 18:28:30 CEST 2006


Hi,

I am trying to wrap an external library that uses "const wchar_t *" a arguments for several methods. I know that if they would have used std::wstring the conversion would have been straight forward. Is there anyway to convert python unicode string to wchar_t pointers ?

Can I make the following code work without writting a wrapper function that uses a wstring as an argument ?

in C++:

void printText( const wchar_t* str )
{
    std::wcout << str;
}


in python:

MyModule.printText( u"The message" )


Thanks

Rodrigue Cloutier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060501/8ed4ed86/attachment.htm>


More information about the Cplusplus-sig mailing list