Folks,
I'm working on multiligual app using unicode branch and hit an interesting
bit yesterday.
I'm trying to present a (cyrillic) tag in url-ready form. Usually this is
solved by
{{ tagname|urlencode }}
But when the 'tagname' contains non-ascii symbols, urlencode barfs:
KeyError at /
u'\u0420'
Request Method: GET
Request URL: http://localhost:8088/
Exception Type: KeyError
Exception Value: u'\u0420'
Exception Location: /usr/lib/python2.4/urllib.py in quote, line 1117
Template error
My current (temporary) solution is to encode this manually, in python:
urllib.quote(tagname.encode('utf8')
But this is not DRY and makes me think there's a better way.
Or it's time to add a custom filter?
--
Andrey V Khavryuchenko
http://www.kds.com.ua
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---