diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-13 14:22:13 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-13 14:22:13 (GMT) |
commit | 6cb2b5b1e1ded4c10e305e493e016a7ccf0275cd (patch) | |
tree | 6800c6a1d5432828de72b0e1c08fca0510feda52 /Doc/library | |
parent | aeaecfd25761b89820db258ca6c60f3c58c0502a (diff) | |
download | cpython-6cb2b5b1e1ded4c10e305e493e016a7ccf0275cd.zip cpython-6cb2b5b1e1ded4c10e305e493e016a7ccf0275cd.tar.gz cpython-6cb2b5b1e1ded4c10e305e493e016a7ccf0275cd.tar.bz2 |
Issue #17827: Document codecs.encode and codecs.decode
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/codecs.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index a5a27a2..004f5c7 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -22,6 +22,25 @@ manages the codec and error handling lookup process. It defines the following functions: +.. function:: encode(obj, encoding='utf-8', errors='strict') + + Encodes *obj* using the codec registered for *encoding*. + + *Errors* may be given to set the desired error handling scheme. The + default error handler is ``strict`` meaning that encoding errors raise + :exc:`ValueError` (or a more codec specific subclass, such as + :exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more + information on codec error handling. + +.. function:: decode(obj, encoding='utf-8', errors='strict') + + Decodes *obj* using the codec registered for *encoding*. + + *Errors* may be given to set the desired error handling scheme. The + default error handler is ``strict`` meaning that decoding errors raise + :exc:`ValueError` (or a more codec specific subclass, such as + :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more + information on codec error handling. .. function:: register(search_function) |