encode

encode given value (default: base-64)


Parameters

encode value :string :literal :pathliteral

Attributes

url encode URL based on RFC3986
spaces also encode spaces
slashes also encode slashes
from :string source character encoding (default: CP1252)
to :string target character encoding (default: UTF-8)

Returns

  • :string
  • or  :nothing

Examples

copy
print encode "Numquam fugiens respexeris" ; TnVtcXVhbSBmdWdpZW5zIHJlc3BleGVyaXM=

copy
print encode.url "http://foo bar/" ; http%3A%2F%2Ffoo+bar%2F

Related