diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2022-07-18 23:35:31 +0200 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2022-07-20 15:42:27 +0800 |
commit | cccb827886773066665e99df4a4ecec4ab5bda14 (patch) | |
tree | c0f54b2a2112d5e4e8bb957ab19524c74bdf2ea8 /src/py_utils.cc | |
parent | 62a544551af64be153824a718d873dd1f34b4cb0 (diff) | |
download | fork-ledger-cccb827886773066665e99df4a4ecec4ab5bda14.tar.gz fork-ledger-cccb827886773066665e99df4a4ecec4ab5bda14.tar.bz2 fork-ledger-cccb827886773066665e99df4a4ecec4ab5bda14.zip |
Properly handle PyUnicode_1BYTE_DATA
Diffstat (limited to 'src/py_utils.cc')
-rw-r--r-- | src/py_utils.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/py_utils.cc b/src/py_utils.cc index 704237d6..cf416e08 100644 --- a/src/py_utils.cc +++ b/src/py_utils.cc @@ -140,9 +140,7 @@ struct string_from_python switch (PyUnicode_KIND(obj_ptr)) { case PyUnicode_1BYTE_KIND: value = (const char*)PyUnicode_1BYTE_DATA(obj_ptr); - // FIXME: It seems wrong to use `utf16to8` on 1BYTE_DATA, yet without this call - // the tests fail with: libc++abi: terminating with uncaught exception of type int - utf8::unchecked::utf16to8(value, value + size, std::back_inserter(str)); + str = std::string(value); break; #if PY_MINOR_VERSION < 12 && Py_UNICODE_SIZE == 2 case PyUnicode_WCHAR_KIND: |