From d5e957204c2799f07f9ecf868d2d846bea5682ef Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 20 Nov 2009 23:23:44 -0500 Subject: Fixed Ledger/Python byte vs. char Unicode bridge --- src/py_utils.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/py_utils.cc') diff --git a/src/py_utils.cc b/src/py_utils.cc index 2736ed3e..5203599f 100644 --- a/src/py_utils.cc +++ b/src/py_utils.cc @@ -79,15 +79,8 @@ struct string_to_python { static PyObject* convert(const string& str) { -#if 1 - // Return a Unicode object - PyObject * pstr = PyString_FromString(str.c_str()); - PyObject * uni = PyUnicode_FromEncodedObject(pstr, "UTF-8", NULL); - return object(handle<>(borrowed(uni))).ptr(); -#else - // Return a 7-bit ASCII string + // Return bytes, not characters; see __unicode__ methods for that return incref(object(static_cast(str)).ptr()); -#endif } }; -- cgit v1.2.3