On Thu, 2007-05-24 at 09:13 -0700, sandro dentella wrote:
> Hi Malcom,
> 
>   I really welcome this branch and thank you all for the effort.
> 
>   Before I consider a bug what follows I'd ask if this should entitle
> me to use
>   non ASCII letters in tests with test.client.
> 
>    I tried something like self.client.get(url, dict(name=u'F\xf2')) to
> get back
>   an error from urlparse
> 
>   File "/misc/src/django/branches/unicode/django/test/client.py", line
> 196, in get
>     r = {
>   File "/usr/lib/python2.4/urllib.py", line 1162, in urlencode
>     v = quote_plus(str(v))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf2' in
> position 1: ordinal not in range(128)

Excellent stuff. That's a bug. Python's urllib.quote_plus doesn't handle
unicode characters (with some reasonably good reasons) and calling str()
on anything is not such a hot idea any longer. So Django has it's own
django.utils.html.urlquote_plus() function that we can use as a
replacement. Not sure how I overlooked that one, but I'll fix it
shortly.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to