Kaydet (Commit) 8d40c843 authored tarafından Guido van Rossum's avatar Guido van Rossum

Added quote_plus() and unquote_plus(), to do space/plus substitutions

for form field values.
Also corrected substitution example (the original changed the spelling
of "conolly" to "connolly" :).
üst 0564e123
......@@ -59,7 +59,12 @@ Letters, digits, and the characters ``\code{_,.-}'' are never quoted.
The optional \var{addsafe} parameter specifies additional characters
that should not be quoted --- its default value is \code{'/'}.
Example: \code{quote('/\~conolly/')} yields \code{'/\%7econnolly/'}.
Example: \code{quote('/\~connolly/')} yields \code{'/\%7econnolly/'}.
\end{funcdesc}
\begin{funcdesc}{quote_plus}{string\optional{\, addsafe}}
Like \code{quote()}, but also replaces spaces by plus signs, as
required for quoting HTML form values.
\end{funcdesc}
\begin{funcdesc}{unquote}{string}
......@@ -68,6 +73,11 @@ Replace \samp{\%xx} escapes by their single-character equivalent.
Example: \code{unquote('/\%7Econnolly/')} yields \code{'/\~connolly/'}.
\end{funcdesc}
\begin{funcdesc}{unquote_plus}{string}
Like \code{unquote()}, but also replaces plus signs by spaces, as
required for unquoting HTML form values.
\end{funcdesc}
Restrictions:
\begin{itemize}
......
......@@ -59,7 +59,12 @@ Letters, digits, and the characters ``\code{_,.-}'' are never quoted.
The optional \var{addsafe} parameter specifies additional characters
that should not be quoted --- its default value is \code{'/'}.
Example: \code{quote('/\~conolly/')} yields \code{'/\%7econnolly/'}.
Example: \code{quote('/\~connolly/')} yields \code{'/\%7econnolly/'}.
\end{funcdesc}
\begin{funcdesc}{quote_plus}{string\optional{\, addsafe}}
Like \code{quote()}, but also replaces spaces by plus signs, as
required for quoting HTML form values.
\end{funcdesc}
\begin{funcdesc}{unquote}{string}
......@@ -68,6 +73,11 @@ Replace \samp{\%xx} escapes by their single-character equivalent.
Example: \code{unquote('/\%7Econnolly/')} yields \code{'/\~connolly/'}.
\end{funcdesc}
\begin{funcdesc}{unquote_plus}{string}
Like \code{unquote()}, but also replaces plus signs by spaces, as
required for unquoting HTML form values.
\end{funcdesc}
Restrictions:
\begin{itemize}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment