]> granicus.if.org Git - python/commitdiff
added small clarification to the descriptions of encode() and decode()
authorSkip Montanaro <skip@pobox.com>
Tue, 16 Apr 2002 15:12:10 +0000 (15:12 +0000)
committerSkip Montanaro <skip@pobox.com>
Tue, 16 Apr 2002 15:12:10 +0000 (15:12 +0000)
Doc/lib/libcodecs.tex

index 396b4b3b5f8aa2141fdd97161ce5c2fb9790928b..efb710d001739ac49ac391a55951e80188c24013 100644 (file)
@@ -201,7 +201,10 @@ function interfaces of the stateless encoder and decoder:
 
 \begin{methoddesc}{encode}{input\optional{, errors}}
   Encodes the object \var{input} and returns a tuple (output object,
-  length consumed).
+  length consumed).  While codecs are not restricted to use with Unicode, in
+  a Unicode context, encoding converts a Unicode object to a plain string
+  using a particular character set encoding (e.g., \code{cp1252} or
+  \code{iso-8859-1}).
 
   \var{errors} defines the error handling to apply. It defaults to
   \code{'strict'} handling.
@@ -216,7 +219,8 @@ function interfaces of the stateless encoder and decoder:
 
 \begin{methoddesc}{decode}{input\optional{, errors}}
   Decodes the object \var{input} and returns a tuple (output object,
-  length consumed).
+  length consumed).  In a Unicode context, decoding converts a plain string
+  encoded using a particular character set encoding to a Unicode object.
 
   \var{input} must be an object which provides the \code{bf_getreadbuf}
   buffer slot.  Python strings, buffer objects and memory mapped files