diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-20 23:23:44 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-20 23:23:44 -0500 |
commit | d5e957204c2799f07f9ecf868d2d846bea5682ef (patch) | |
tree | e2618ed53b09e0ea7d0d5871c237ec3b5127faae /src/py_utils.cc | |
parent | bd455c98743ce354b875d67a1d607a682d604fe0 (diff) | |
download | fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.tar.gz fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.tar.bz2 fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.zip |
Fixed Ledger/Python byte vs. char Unicode bridge
Diffstat (limited to 'src/py_utils.cc')
-rw-r--r-- | src/py_utils.cc | 9 |
1 files changed, 1 insertions, 8 deletions
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<const std::string&>(str)).ptr()); -#endif } }; |