Handbook
Glossary
(url-encode) ( str quot: ( ch -- ? ) -- encoded )
Vocabulary
urls
.
encoding
.
private
Inputs
str
an
object
quot
a
quotation
with stack effect
( ch -- ? )
Outputs
encoded
an
object
Definition
USING:
byte-arrays
kernel
make
present
sequences
;
IN:
urls.encoding.private
:
(url-encode)
( str quot: ( ch -- ? ) -- encoded )
[
over
byte-sequence?
[
[
[
dup
]
]
dip
[
[
,
]
[
hex%
]
if
]
compose
compose
each
]
[
[
present
]
dip
[
[
dup
]
]
dip
[
[
,
]
[
hex-utf8%
]
if
]
compose
compose
each
]
if
]
""
make
;
inline