Boost.Python and Unicode

My C++ code uses std::string as storage for UTF-8 strings. I am exporting some of my C++ APIs to Python using Boost.Python, and I would like to somehow Boost.Python about the fact that my strings are UTF-8 strings. Ideally, this would mean that Boost.Python would convert my std::strings to Python unicode objects on the way from C++ to Python, and that any Python unicode objects passed into my C++ library would be converted to UTF-8 encoded std::strings. What's the best way to go about doing this? Thanks, Ben -- If this message helped you, consider buying an item from my wish list: <http://artins.org/ben/wishlist> I changed my name: <http://periodic-kingdom.org/People/NameChange.php>

Ben Artin <macdev@artins.org> writes:
My C++ code uses std::string as storage for UTF-8 strings. I am exporting some of my C++ APIs to Python using Boost.Python, and I would like to somehow Boost.Python about the fact that my strings are UTF-8 strings. Ideally, this would mean that Boost.Python would convert my std::strings to Python unicode objects on the way from C++ to Python, and that any Python unicode objects passed into my C++ library would be converted to UTF-8 encoded std::strings.
What's the best way to go about doing this?
I don't know, but if you come to the C++-sig it's more likely you'll hear from someone who does. http://www.boost.org/more/mailing_lists.htm#cplussig HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
Ben Artin
-
David Abrahams