On 2012.7.24 9:53 PM, Jonathan Nieder wrote:
> Michael G Schwern wrote:
>> No, now it's just canonicalizing as early as possible.  Preferably within the
>> object accessor rather than at the point of use.  So in the code below,
>> $full_url is already escaped/canonicalized.
> Let's start with this.
> Is svn_path_canonicalize() idempotent?  What does it do when it
> encounters a percent-sign?

Nothing, because paths are not URI escaped. :)

You probably meant svn_uri_canonicalize().  And no, it does not double escape,
so its safe to escape as early as possible.

   use SVN::Core;

   my $uri = "http://www.example.com/ foo";

    print SVN::_Core::svn_uri_canonicalize(

That produces "http://www.example.com/%20foo";.

The API docs don't say it specifically, but if it were otherwise it would be
impossible to use.  You'd have to check first if anything were escaped before
canonicalizing.  And a user couldn't pass in an escaped URL without risking it
being double escaped.


'All anyone gets in a mirror is themselves,' she said. 'But what you
gets in a good gumbo is everything.'
    -- "Witches Abroad" by Terry Prachett
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to