[Function] percent-decode

Package

ystok.uri

Signature

percent-decode string &key external-format => result-string

Arguments
string
An arbitrary string, usually a character representation of some part of a URI, possibly non-simple and containing '%HH' or '%uHHHH' escape sequences.
external-format
An external format designator; defaults to the value of *default-external-format*.
Values

A simple string with all escape sequences percent-decoded into corresponding characters.

Description

The function analyses escape sequences within string and convert them first to octets and then to characters.

external-format is either :utf-8 or a designator of a single-byte external format in accordance to your Lisp implementation or FLEXI-STREAMS specification.

The current version of the percent-decode supports only single-byte external formats, for example :latin-1 or :windows-1251. In contrast, the percent-encode function accepts any external format supported by your Lisp implementation or by ACL-Compat or FLEXI-STREAMS.