[C++-sig] Re: passing a unicode string from python to c++ std::wstring

David Abrahams dave at boost-consulting.com
Sat May 1 16:37:43 CEST 2004

Andrew Thomas Corrigan <acorriga at cs.stevens-tech.edu> writes:

> I asked about this a week ago with no reply.  So I'm asking again since
> it seems to me like a major bug in boost python, which will ultimately
> force me to fix it myself, or abandon python.
> Has anyone ever succesfully passed to a c++ function, that expects a
> std::wstring, a unicode string that is longer than 7 characters?
> Is this a well known bug, that is already being taken care of?

Yes, the standard Boost.Python regression tests do this:

  >>> rewrap_value_wstring(u'yo, wassup?')
  u'yo, wassup?'

If there's a bug, how do you know it's not in your own code?

If you think there's a bug in Boost.Python, you ought to be able to
produce a very simple test case that will reproduce the problem.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list