From: Steve Callaway Date: 2006-07-07T16:51:46+09:00 Subject: Re: Danish Characters in Ruby Uri ah cool, thanks very much, that looks a much sweeter fix :) rgds Steve --- Carlos wrote: > Steve Callaway wrote: > > > Hi, > > > > There would appear to be a deficiency in the > common.rb > > URI module of uri when processing non-standard > > characters > > > > e.g. > > > > c:/ruby/lib/ruby/1.8/uri/common.rb:432:in `split': > bad > > URI(is not URI?): http:// > > fakebase/twiki/bin/view/Main/�stermark > > (URI::InvalidURIError) > > from c:/ruby/lib/ruby/1.8/uri/common.rb:481:in > `parse' > > from c:/ruby/lib/ruby/1.8/open-uri.rb:85:in `open' > > from testbed.rb:15 > > > > I have chcped till I am blue in the face, gsubbed > the > > string, etc, etc, but the uri parser won't have > some > > Danish characters in any shape or form. Anyone > have > > any idea how I can persuade uri to take them, or > some > > other viable method of getting a page back with > Danish > > chars in it, or am I going to have to hack my > local > > copy of common.rb apart to make this happen? > > Just apply URI.encode first. That will change the > URI to > http://fakebase/twiki/bin/view/Main/%C3%98stermark > (or something > different if you are not using UTF-8), which is > valid. > > Good luck. > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com