diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-11-18 23:00:32 -0200 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-02-15 10:10:51 +1100 |
commit | ea39a9952e3fa647ebcb4bf16981ce941ec5236a (patch) | |
tree | a3654dddba1734982126a69740d7e53fbc049edd | |
parent | e21dfae1526814152603122f2ac4c9d36a7d814d (diff) | |
download | patchwork-ea39a9952e3fa647ebcb4bf16981ce941ec5236a.tar patchwork-ea39a9952e3fa647ebcb4bf16981ce941ec5236a.tar.gz |
Fix non-ascii character encodings on xmlrpc interface
The current xmlrpc interface dies when trying to retrieve patches
that contain non-ascii characters.
This change uses unicode() rather than str().
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | apps/patchwork/views/xmlrpc.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py index 791c89e..89c6bd6 100644 --- a/apps/patchwork/views/xmlrpc.py +++ b/apps/patchwork/views/xmlrpc.py @@ -173,7 +173,7 @@ def person_to_dict(obj): 'id' : obj.id, 'email' : obj.email, 'name' : obj.name, - 'user' : str(obj.user), + 'user' : unicode(obj.user).encode("utf-8"), } def patch_to_dict(obj): @@ -182,17 +182,17 @@ def patch_to_dict(obj): return \ { 'id' : obj.id, - 'date' : str(obj.date), + 'date' : unicode(obj.date).encode("utf-8"), 'filename' : obj.filename(), 'msgid' : obj.msgid, 'name' : obj.name, - 'project' : str(obj.project), + 'project' : unicode(obj.project).encode("utf-8"), 'project_id' : obj.project_id, - 'state' : str(obj.state), + 'state' : unicode(obj.state).encode("utf-8"), 'state_id' : obj.state_id, - 'submitter' : str(obj.submitter), + 'submitter' : unicode(obj.submitter).encode("utf-8"), 'submitter_id' : obj.submitter_id, - 'delegate' : str(obj.delegate), + 'delegate' : unicode(obj.delegate).encode("utf-8"), 'delegate_id' : max(obj.delegate_id, 0), 'commit_ref' : max(obj.commit_ref, ''), } |