Summary: | User alias with UTF-8 character are not working | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Aurélien Bauchet <baucheta> |
Component: | butterfly | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | minor | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Utf-8 mishandling workaround patch
tp-butterfly utf-8 mishandling user aliases patch |
Description
Aurélien Bauchet
2008-12-24 06:28:01 UTC
Created attachment 21469 [details] [review] Utf-8 mishandling workaround patch The bug can be reproduced directly in a python shell: >>> import urllib >>> urllib.quote(u'Aurélien') /usr/lib/python2.5/urllib.py:1205: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal res = map(safe_map.__getitem__, s) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/urllib.py", line 1205, in quote res = map(safe_map.__getitem__, s) KeyError: u'\xe9' It seems to be a known problem: http://coding.derkeiler.com/Archive/Python/comp.lang.python/2008-10/msg00432.html Using the hint provided before, I create a patch that corrects this error. It mainly encode the utf-8 string before the quote. pymsn expects all user strings to be utf-8 encoded string instances (not unicode instance). To me it seems that the program you are using is not using pymsn correctly. Well, the application using it is the telepathy-butterly connector, the main and only application (to my knowlegde) using the pymsn library. Then, should this bug be assigned to the telepathy-butterfly team then, if you consider it's not a pymsn bug? yes, please do as I am no longer the maintainer of telepathy-butterfly. Created attachment 21494 [details] [review] tp-butterfly utf-8 mishandling user aliases patch Correct the mentionned bug but in the telepathy-butterfly source code. It's seems that indeed the encode method was missing as it was applied to alias for classic contact aliases. Works on 0.3.2 release of telepathy-butterfly Reassigning it to the telepathy-butterfly team. commit 43a961b920edf21f83e6478385d172fd9eb660aa Author: Jonny Lamb <jonny.lamb@collabora.co.uk> Date: Sun Dec 28 14:48:32 2008 +0000 Encode the user alias as UTF-8 when setting a new display name. "It seems that indeed the encode method was missing as it was applied to alias for classic contact aliases." Thanks to Aurélien Bauchet <baucheta@gmail.com> for the patch. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.