[Gambas-user] URL encoding "%20"
Benoit Minisini
gambas at ...1...
Wed Dec 31 10:22:15 CET 2008
On mercredi 31 décembre 2008, Doriano Blengino wrote:
> Rob ha scritto:
> > On Tuesday 30 December 2008 19:44, werner 007 wrote:
> >> First when i read your solution i was thinking "damn, i was lazy to make
> >> a good job".
> >> But then, we are not looking for single chars but for three at once.
> >
> > I misunderstood you, then. URL encoding is replacing non-printable
> > characters with %xx. URL DEcoding is replacing %xx with the original
> > non-printable character. What I wrote will be fine for encoding and what
> > you wrote in this response will be fine if you rename the function
> > to "urldecode".
>
> ...and don't forget that URL's ENcoding and DEcoding deals with other
> characters too (not merely the non-printable ones), for example the "%"
> itself should be encoded, and probably others (I don't have the specs at
> hands). The correct ENcoding of " % " (blank-percent-blank) is
> "%20%25%20", *not* "%20%%20"...
You have CGI.Encode() and CGI.Decode() in the gb.web component that do what
you are talking about. You can take the source code if you need.
Regards,
--
Benoit Minisini
More information about the User
mailing list