definition:
|
string2urlencoded :: String -> String
string2urlencoded [] = []
string2urlencoded (c:cs)
| isAlphaNum c = c : string2urlencoded cs
| c == ' ' = '+' : string2urlencoded cs
| otherwise
= let oc = ord c
in '%' : int2hex(oc `div` 16) : int2hex(oc `mod` 16) : string2urlencoded cs
where
int2hex i = if i<10 then chr (ord '0' + i)
else chr (ord 'A' + i - 10)
|
demand:
|
argument 1
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Translates arbitrary strings into equivalent URL encoded strings.
|
failfree:
|
_
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({[]}) |-> {[]} || ({:}) |-> {:}}
|
name:
|
string2urlencoded
|
precedence:
|
no precedence defined
|
result-values:
|
{:,[]}
|
signature:
|
String -> String
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|