On Tue, 2007-06-05 at 17:47 +0300, Andrey Khavryuchenko wrote:
>
> MT> Have a look at the iriencode filter (only in the unicode branch, so
> MT> you'll need to read docs/templates.txt from the source). This handles
> MT> the last stage of encoding to ASCII.
>
> Thanks for pointer.
>
> MT> You cannot necessarily skip the urlencode portion, but you may be able
> MT> to. The reason is that the IRI -> URI conversion algorithm does _not_
> MT> encode things like '%', so it is safe to apply to something that has
> MT> already been partially encoded. However, if your proto-URL string
> MT> contains a '%' that should be encoded (e.g. "100%-guaranteed"), you will
> MT> need to pass it through urlencode first.
>
> MT> So {{ tagname|urlencode|iriencode }} is completely safe, although
> MT> possibly redundant (and even incorrect if tagname was something that had
> MT> already been URL encoded).
>
> Well, I think here you've missed the point. Python fails *before*
> iriencode - during urlencode. Check the traceback again:
Ah, I see. For some reason I forgot to switch the urlencode filter over
to use django.utils.http.urlquote(). I'll fix that in the morning.
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
-~----------~----~----~----~------~----~------~--~---