added urlencode filter, fix for issue #17 #62

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

No description provided.

Contributor

snoack commented on jinja2/filters.py in 37303a8 Oct 28, 2011

Why do you call the filter urlencode if its actually urllib.quote, not urllib.urlencode?

because it was called this way in jinja-1

Owner

mitsuhiko commented on 37303a8 Nov 2, 2011

This is not unicode safe. If we would integrate such a filter we would have to select a default encoding. Not sure what to do there. Maybe force UTF-8 on everybody.

Contributor

snoack replied Nov 2, 2011

I also don't like the plus argument, because of that makes the choice whether to use the plus-variant or not up to the template author. But your application might require that all urls are quoted the same certain way.

In my opinion it would be appropriate to leave the implementation of that filter to the user, instead of providing a default implementation that either makes decisions (about the encoding and whether or not to use the plus-variant) for the user or requires them as argument, each time the filter is used.

Contributor

snoack commented on jinja2/filters.py in 37303a8 Nov 2, 2011

The ... if ... else ... syntax isn't compatible with Python 2.4.

Owner

mitsuhiko commented May 19, 2013

Duplicate, already implemented.

mitsuhiko closed this May 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment