percent-encoding

2012-10-13

PERCENT-ENCODING

What is this?

Percent-encoding is a library for percent-encoding defined in RFC 3986 and varieties.

RFC 3986???????? ??????????????? ???????????????????

License

It's licensed under the MIT license.

Requirements

API

Encoding And Decoding

Function: encode string &key test www-form encoding

Encodes string according to percent-encoding and returns it as a string.

string????????????????????????????????????

test is a function of one argument that returns a generalized boolean. It's used for determining whether each octet requires encoding. If it returns false, the octet is encoded. The default value is #'unreservedp.

test????????????????????????????????????? ?????????????????????????????????????? ?????????????????#'unreservedp???

If www-form is true, returns an application/x-www-form-urlencoded string instead of an RFC 3986 percent-encoded string.

www-form??????RFC 3986??????????????????? application/x-www-form-urlencoded????????????????????

encoding is a character encoding scheme (CES). string is encoded using the CES before percent-encoding. This argument is passed to babel:string-to-octets without any change.

encoding?????????CES????string???????????????? ???CES???????????????????babel:string-to-octets???? ???????

Function: decode string &key test www-form encoding

Decodes string according to percent-encoding and returns it as a string.

string???????????????????????????????????

test is a function of one argument that returns a generalized boolean. It's used for determining whether each octet requires decoding. If it returns true, the octet is decoded. The default value is (constantly t).

test???????????????????????????????????? ???????????????????????????????????????? ??????????????(constantly t)???

If www-form is true, assumes that string is an application/x-www-form-urlencoded string.

www-form??????string?application/x-www-form-urlencoded??????? ????????????

encoding is a character encoding scheme (CES). string is decoded according to the CES after percent-decoding. This argument is passed to babel:octets-to-string without any change.

encoding?????????CES????string???????????????? ??????????CES?????????????????? babel:octets-to-string???????????

Predicates

Function: gen-delims-p x

Function: sub-delims-p x

Function: reservedp x

Function: alphap x

Function: digitp x

Function: unreservedp x

Function: userinfop x

Function: reg-name-p x

Function: pcharp x

Function: queryp x

Function: fragmentp x

Returns true if the octet x is a member of each character set. See RFC 3986.

?????x????????????????????????RFC 3986????? ???

Acknowledgements

The API of percent-encoding was inspired by Daniel Oliveira's do-urlencode and Franz's uri.

percent-encoding?API?Daniel Oliveira??? do-urlencode?Franz? uri??????????

sile's url gave some important hints for speed to me.

sile???url???????? ??????????

Author
Manabu Takayama <learn.libra@gmail.com>
License
MIT License
Categories
max rottenkolber