brianmario/escape_utils — Issue #23: Wanted: correct URI escaping
Author: technoweenie
Created: 2012-01-07 21:26:37+00:00
State: open

Look at the difference:

```
>> EscapeUtils.escape_uri 'a +b'
=> "a/%20+b"
>> EscapeUtils.escape_url 'a/ +b'
=> "a%2F+%2Bb"
```

IMO both are wrong. Also, the similarity in the two method names is ridiculous. This is what I'd like to see:

```
>> EscapeUtils.escape_full_uri 'a/ +b'
=> "a/%20%2Bb"
>> EscapeUtils.escape_uri_path 'a/ +b'
=> "a%2F%20%2Bb"
```

This is closer to how javascript works:

```
> encodeURI('a/ +b')
'a/%20+b'
> encodeURIComponent('a/ +b')
'a%2F%20%2Bb'
```

I like to escape `+` to be safe, because it's not entirely clear if you mean a `+` or a space. If you agree, I'll happily hack it up and send you a pull. If not, I'll do it anyway and force my fork in GitHub :) :)