On Wed, 2003-06-04 at 04:11, Wade Bowmer wrote:
> At 02:08 PM 3/06/2003 -0700, Steve Wampler wrote:
>
> >Is there anything in Unicon that takes a string and maps HTML
> >character encodings back into the real world? That is, given:
> >
> > "ftp%3A%2F%2Fsolarch.tuc.noao.edu%2FSPMG_cdrom%2"
> >
> >the result is:
> >
> > ftp://solarch.tuc.noao.edu/FSPMG_cdrom/
> >
> >I don't see anything obvious in there html.icn or cgi.icn in the IPL.
>
> cgiReadParse() in cgi.icn does what you want, but it looks directly at
> $QUERY_STRING. Look in http://yceran.org/qompose/qompose.icn for a version
> I modified that takes an argument.
>
> I did want to use cgi.icn for Qompose, but it was tricky modifying cgi.icn
> so that I could both use it the way I wanted and it would still work as it
> currently does.
Hi Wade (and others),
Thanks for all the suggestions. I had also stumbled on the code in
cgiReadParse() and ended up adapting that code for my purpose.
cgiReadParse() was too specific for my needs - besides looking
directly at $QUERY_STRING, it also only decodes values and the
case I'm looking at needs to decode names as well. (Oddly
enough, you seem to be able to use arbitrary strings for names
of input fields in HTML forms...)
For the record, here's what I used - others of you had nice
solutions as well!
------------------------------------------------
procedure cgiUnmapHtmlEscapes(s)
static hexen
initial hex := cset(&digits || "ABCDEF")
while s ?:= tab(upto('%')) ||
(="%",
(c1 := tab(any(hex))) & (c2 := tab(any(hex))),
cgiHexchar(c1,c2)) ||
tab(0)
return s
end
-----------------------------------------------
Thanks again!
--
Steve Wampler -- [EMAIL PROTECTED]
Quantum materiae materietur marmota monax si marmota
monax materiam possit materiari?
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group