diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-12-03 21:13:05 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-03 21:13:05 +0900 |
commit | e419cd8e2db6b8226bd681b52b6acfe70d8e6a86 (patch) | |
tree | 218200abdf432642b1c47482cdf38a117fac5a93 /msgpack/unpack.h | |
parent | 83ebb63c447a99c81d043eb6808bbfb50697a751 (diff) | |
download | msgpack-python-e419cd8e2db6b8226bd681b52b6acfe70d8e6a86.tar.gz |
Remove encoding option from Unpacker. (#380)
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r-- | msgpack/unpack.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index bbce91c..539a991 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -27,7 +27,6 @@ typedef struct unpack_user { PyObject *object_hook; PyObject *list_hook; PyObject *ext_hook; - const char *encoding; const char *unicode_errors; Py_ssize_t max_str_len, max_bin_len, max_array_len, max_map_len, max_ext_len; } unpack_user; @@ -232,9 +231,7 @@ static inline int unpack_callback_raw(unpack_user* u, const char* b, const char* PyObject *py; - if (u->encoding) { - py = PyUnicode_Decode(p, l, u->encoding, u->unicode_errors); - } else if (u->raw) { + if (u->raw) { py = PyBytes_FromStringAndSize(p, l); } else { py = PyUnicode_DecodeUTF8(p, l, u->unicode_errors); |