mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-23 22:03:18 +00:00
Remove encoding option from Unpacker. (#380)
This commit is contained in:
parent
83ebb63c44
commit
e419cd8e2d
4 changed files with 15 additions and 51 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue