Open-URI and percent sign in url

I am trying to use open-uri to open the following url
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start
and I’m getting the following error

:/ruby/lib/ruby/1.8/uri/common.rb:436:in split': bad URI(is not URI?): http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start (URI::InvalidURIError) from c:/ruby/lib/ruby/1.8/uri/common.rb:485:inparse’
from c:/ruby/lib/ruby/1.8/open-uri.rb:29:in `open’
from mitbook.rb:14

However, the url works fine in the browser.

thanks,

Luis

On Sep 27, 2007, at 08:58 , [email protected] wrote:

I am trying to use open-uri to open the following url
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%
_toc_start
and I’m getting the following error

%_t is not a valid % escape sequence. You probably want …#%25_toc…

However, the url works fine in the browser.

The browser is more forgiving, which is nice for people like my parents.

On Sep 27, 11:15 am, Eric H. [email protected] wrote:

The browser is more forgiving, which is nice for people like my parents.

Thanks. That worked!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs