Functions

std::string url_encode(const std::string &o, bool use_plus_space = true)

URL-encode a string o, escaping all reserved, special, or non-ASCII characters with percent-encoding.

If use_plus_space is true, spaces will be replaced with + rather than %20.

std::string url_decode(const std::string&)

Decode a URL- or percent-encoded string. Throws url_decode_error if the input string is not validly encoded.

string show::base64_encode(const std::string &o, const char *chars = base64_chars_standard)

Base-64 a string o using the character set chars, which must point to a char array of length 64.

std::string base64_decode(const std::string &o, const char *chars = base64_chars_standard)

Decode a base-64 encoded string o using the character set chars, which must point to a char array of length 64. Throws a base64_decode_error if the input is not encoded against chars or has incorrect padding.