mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-08-11 17:31:37 +00:00
strings in utf-8 instead of unicode when deserializing obj/objlists
This commit is contained in:
parent
b3dd6a2e4c
commit
a0d0e78e8b
@ -18,6 +18,9 @@ class _SearpcObjProps(object):
|
|||||||
value = dicts[key]
|
value = dicts[key]
|
||||||
# replace hyphen with with underline
|
# replace hyphen with with underline
|
||||||
new_key = key.replace('-', '_')
|
new_key = key.replace('-', '_')
|
||||||
|
# encode all strings in UTF-8
|
||||||
|
if isinstance(value, unicode):
|
||||||
|
value = value.encode('utf-8')
|
||||||
new_dict[new_key] = value
|
new_dict[new_key] = value
|
||||||
|
|
||||||
self._dicts = new_dict
|
self._dicts = new_dict
|
||||||
|
Loading…
Reference in New Issue
Block a user