Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
41
Task/URL-encoding/Bracmat/url-encoding.bracmat
Normal file
41
Task/URL-encoding/Bracmat/url-encoding.bracmat
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
( ( encode
|
||||
= encoded exceptions octet string
|
||||
. !arg:(?exceptions.?string)
|
||||
& :?encoded
|
||||
& @( !string
|
||||
: ?
|
||||
( %@?octet ?
|
||||
& !encoded
|
||||
( !octet
|
||||
: ( ~<0:~>9
|
||||
| ~<A:~>Z
|
||||
| ~<a:~>z
|
||||
)
|
||||
| @(!exceptions:? !octet ?)
|
||||
& !octet
|
||||
| "%" d2x$(asc$!octet)
|
||||
)
|
||||
: ?encoded
|
||||
& ~
|
||||
)
|
||||
)
|
||||
| str$!encoded
|
||||
)
|
||||
& out$"without exceptions:
|
||||
"
|
||||
& out$(encode$(."http://foo bar/"))
|
||||
& out$(encode$(."mailto:Ivan"))
|
||||
& out$(encode$(."Aim <ivan.aim@email.com>"))
|
||||
& out$(encode$(."mailto:Irma"))
|
||||
& out$(encode$(."User <irma.user@mail.com>"))
|
||||
& out$(encode$(."http://foo.bar.com/~user-name/_subdir/*~.html"))
|
||||
& out$"
|
||||
with RFC 3986 rules:
|
||||
"
|
||||
& out$(encode$("-._~"."http://foo bar/"))
|
||||
& out$(encode$("-._~"."mailto:Ivan"))
|
||||
& out$(encode$("-._~"."Aim <ivan.aim@email.com>"))
|
||||
& out$(encode$("-._~"."mailto:Irma"))
|
||||
& out$(encode$("-._~"."User <irma.user@mail.com>"))
|
||||
& out$(encode$("-._~"."http://foo.bar.com/~user-name/_subdir/*~.html"))
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue