module URLEncoding
Extended Modules
Defined in:
urlencoding.crConstant Summary
-
VERSION =
"1.0.0"
Instance Method Summary
-
#decode(data)
Decode percent-encoded string assuming UTF-8 encoding.
-
#decode_binary(data)
Decode percent-encoded string as binary data, in any encoding.
-
#encode(data)
Percent-encodes every byte except alphanumerics and -, _, ., ~.
-
#encode_binary(data)
Percent-encodes every byte except alphanumerics and -, _, ., ~.
Instance Method Detail
Decode percent-encoded string assuming UTF-8 encoding.
Example:
res = URLEncoding.decode("%F0%9F%91%BE%20Exterminate%21") puts res
@param data @return decoded string
Decode percent-encoded string as binary data, in any encoding.
Example:
res = URLEncoding.decodeBinary("%F1%F2%F3%C0%C1%C2") puts res
@param data @return decoded string
Percent-encodes every byte except alphanumerics and -, _, ., ~. Assumes UTF-8 encoding.
Example:
res = URLEncoding.encode("This string will be URL encoded.") puts res
@param data @return encoded string
Percent-encodes every byte except alphanumerics and -, _, ., ~.
Example:
res = URLEncoding.encodeBinary("This string will be URL encoded.") puts res
@param data @return encoded string