From a0d0e78e8b2e891d4a1f32d76b4636fc757414a5 Mon Sep 17 00:00:00 2001 From: lins05 Date: Mon, 14 May 2012 15:23:35 +0800 Subject: [PATCH] strings in utf-8 instead of unicode when deserializing obj/objlists --- pysearpc/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pysearpc/client.py b/pysearpc/client.py index d3b82e4..0203979 100644 --- a/pysearpc/client.py +++ b/pysearpc/client.py @@ -18,6 +18,9 @@ class _SearpcObjProps(object): value = dicts[key] # replace hyphen with with underline new_key = key.replace('-', '_') + # encode all strings in UTF-8 + if isinstance(value, unicode): + value = value.encode('utf-8') new_dict[new_key] = value self._dicts = new_dict