[Chandler-dev] Re: [commits] (morgen) [11685] People often get spaces in their sharing urls when copying/pasting, so detecting/complaining about them on subscribe

Philippe Bossut pbossut at osafoundation.org
Thu Sep 7 17:46:21 PDT 2006


Hi Morgen,

Rather than a dialog and error, shouldn't we rather use the ISO-Latin 
encoding (used for URLs) and convert those characters? For space, this 
is 32 decimal or 20 in Hex so it becomes '%20' in a URL.

e.g.: http://www.osaf.foo bar.htm -> http://www.osaf.foo%20bar.htm

I'd prefer that to a dialog to be honest. It'll catch some simple 
encoding/decoding cases though, indeed, it might be that the URL is 
wrong anyway...

Cheers,
- Philippe

commits at osafoundation.org wrote:
>
> Revision
>     11685 <http://viewcvs.osafoundation.org/chandler?view=rev&rev=11685>
> Author
>     morgen
> Date
>     2006-09-07 16:49:30 -0700 (Thu, 07 Sep 2006)
>
>
>       Log Message
>
> People often get spaces in their sharing urls when copying/pasting, so 
> detecting/complaining about them on subscribe
>
>
>       Modified Paths
>
>     * trunk/chandler/application/dialogs/SubscribeCollection.py
>       <#trunkchandlerapplicationdialogsSubscribeCollectionpy>
>
>
>       Diff
>
>
>         Modified:
>         trunk/chandler/application/dialogs/SubscribeCollection.py
>         (11684 => 11685)
>
> --- trunk/chandler/application/dialogs/SubscribeCollection.py	2006-09-07 23:48:21 UTC (rev 11684)
> +++ trunk/chandler/application/dialogs/SubscribeCollection.py	2006-09-07 23:49:30 UTC (rev 11685)
> @@ -166,6 +166,11 @@
>          view = self.view
>          url = self.textUrl.GetValue()
>          url = url.strip()
> +
> +        if " " in url:
> +            self._showStatus(_(u"Spaces are not allowed in URLs"))
> +            return
> +
>          if url.startswith('webcal:'):
>              url = 'http:' + url[7:]
>  
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Commits mailing list
> Commits at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/commits
>   


More information about the chandler-dev mailing list