[C++-sig] supporting binary strings

David Abrahams dave at boost-consulting.com
Wed Oct 16 22:12:36 CEST 2002


David Abrahams <dave at boost-consulting.com> writes:

> greg Landrum <greglandrum at mindspring.com> writes:
> 
> > The default string conversion behavior of BPLv2 truncates strings
> > containing nulls.  BPLv1 did not do this (Python strings containing
> > nulls were properly passed to the C++ layer).
> > 
> > I've made two small mods to change the behavior back.  A context diff
> > for the changes is attached.
> 
> Your changes look reasonable to me. The ones in the .cpp file are not
> the most efficient implementation possible, because two copies of the
> C++ string will be created. A more-efficient implementation would not
> be able to use the slot_rvalue_from_python scaffolding, though. I
> think I'll apply your patch; we can optimize later if neccessary.

Done, including a test case.

-- 
                    David Abrahams
dave at boost-consulting.com * http://www.boost-consulting.com

Building C/C++ Extensions for Python: Dec 9-11, Austin, TX
http://www.enthought.com/training/building_extensions.html





More information about the Cplusplus-sig mailing list