added quote and unquote

This commit is contained in:
Guido van Rossum 1995-02-27 17:51:51 +00:00
parent d6304d09cc
commit 61d34f47c3
2 changed files with 32 additions and 2 deletions

View file

@ -2,7 +2,7 @@
\stmodindex{urllib}
\index{WWW}
\indexii{World-Wide}{Web}
\index{URLs}
\index{URL}
This module provides a high-level interface for fetching data across
the World-Wide Web. In particular, the \code{urlopen} function is
@ -49,6 +49,21 @@ Clear the cache that may have been built up by previous calls to
\code{urlretrieve()}.
\end{funcdesc}
\begin{funcdesc}{quote}{string\optional{\, addsafe}}
Replace special characters in \var{string} using the \code{\%xx} escape.
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/'}.
\end{funcdesc}
\begin{funcdesc}{unquote}{string}
Remove \code{\%xx} escapes by their single-character equivalent.
Example: \code{unquote('/\%7Econnolly/')} yields \code{'/~connolly/'}.
\end{funcdesc}
Restrictions:
\begin{itemize}

View file

@ -2,7 +2,7 @@
\stmodindex{urllib}
\index{WWW}
\indexii{World-Wide}{Web}
\index{URLs}
\index{URL}
This module provides a high-level interface for fetching data across
the World-Wide Web. In particular, the \code{urlopen} function is
@ -49,6 +49,21 @@ Clear the cache that may have been built up by previous calls to
\code{urlretrieve()}.
\end{funcdesc}
\begin{funcdesc}{quote}{string\optional{\, addsafe}}
Replace special characters in \var{string} using the \code{\%xx} escape.
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/'}.
\end{funcdesc}
\begin{funcdesc}{unquote}{string}
Remove \code{\%xx} escapes by their single-character equivalent.
Example: \code{unquote('/\%7Econnolly/')} yields \code{'/~connolly/'}.
\end{funcdesc}
Restrictions:
\begin{itemize}