Hi all and my first greetings to this mailing list,
I’ve a small problem with rubies URI.parse(string) function. It throws
me an
exception when I try to parse an URI like: https://.
which
contains hex encoded characters. Unfortunately it’s no option to decode
uri
before parsing.
How could this matter be solved?
Content preview: Hi, On 03.06.2011 10:25, Burger Karsten (LET) wrote: >
Hi
all and my first greetings to this mailing list, > > I’ve a small
problem
with rubies URI.parse(string) function. It throws me an > exception
when I
try to parse an URI like: https://. which > contains
hex encoded
characters. Unfortunately it’s no option to decode uri > before
parsing.
Hi all and my first greetings to this mailing list,
I’ve a small problem with rubies URI.parse(string) function. It throws me an
exception when I try to parse an URI like: https://. which
contains hex encoded characters. Unfortunately it’s no option to decode uri
before parsing.
How could this matter be solved?
I’m no export on URI but I’ve been using it in a few projects lately
which included also studying the source to understand certain parts.
From my conclusion you’re out of luck, URI and friends adhere to the RFC
and what you ask for simply isn’t as per the RFC (see the source of
uri/common.rb for yourself about all the regexp used in there). What you
have is encoded and you need to decode it.
No idea why your restriction is that you cannot decode it before handing
over to URI.parse, but since you choose to use ruby you also know you
can monkey patch URI.parse, so …
Markus
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.