From: Andrew Timberlake Date: 2009-04-13T20:06:24+09:00 Subject: Re: URI.parse and whitespace characters On Mon, Apr 13, 2009 at 12:54 PM, Marcelo Barbudas wrote: > Hi, > > I have to parse a lot of bad links like: > http://www.something.com/bad link.jpg > (spaces in them) > > URI.parse fails parsing them and considers them as faulty links. > > However in my case I need it to work. Is there a workaround for this? > > > -- > M. > > uri = "http://www.something.com/bad link.jpg" URI.parse(uri.gsub(/ /, '+')) #<- replaces all spaces with '+' Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain