Hi Gary,

I agree with the your proposals.  I've got a few concerns with the 
current code:

In django/utils/encoding.py: function iri_to_uri
<<< 
    # The list of safe characters here is constructed from the
    # printable ASCII characters that are not explicitly excluded 
    # by the list at the end of section 3.1 of RFC 3987.
    if iri is None:
        return iri
    return urllib.quote(smart_str(iri), safe='/#%[]=:;$&()+,!?*')
>>>

First, I can't find any list at the end of section 3.1 of RFC 3987, 
unless it's talking about the paragraph starting "Systems accepting 
IRIs MAY also deal with..." which only lists a few characters which 
should not be converted, and not the list given in the code.

Second, the algorithm given in that section is described very 
differently, and it's very hard to see that they are doing the same 
thing. Hence this bug.  However, I can't actually come up with a nicer 
solution, and one that is equally fast is probably even harder.

So, +1 to changing this, as well as some fixes to the comments in the 
code.

Luke

-- 
I teleported home one night
With Ron and Sid and Meg,
Ron stole Meggie's heart away
And I got Sidney's leg
(THHGTTG)

Luke Plant || http://lukeplant.me.uk/

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.


Reply via email to