Module _codecs
[hide private]
[frames] | no frames]

Module _codecs

Functions [hide private]
 
ascii_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
ascii_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
charbuffer_encode(...)
 
charmap_build(...)
 
charmap_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
charmap_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
decode(...)
decode(obj, [encoding[,errors]]) -> object
 
encode(...)
encode(obj, [encoding[,errors]]) -> object
 
escape_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
escape_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
latin_1_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
latin_1_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
(encoder, decoder, stream_reader, stream_writer)
lookup(encoding)
Looks up a codec tuple in the Python codec registry and returns a tuple of functions.
handler
lookup_error(errors)
Return the error handler for the specified error handling name or raise a LookupError, if no handler exists under this name.
 
raw_unicode_escape_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
raw_unicode_escape_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
readbuffer_encode(...)
 
register(search_function)
Register a codec search function.
 
register_error(errors, handler)
Register the specified error handler under the name errors.
 
unicode_escape_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
unicode_escape_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
unicode_internal_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
unicode_internal_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
utf_16_be_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
utf_16_be_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
utf_16_decode(...)
 
utf_16_encode(...)
 
utf_16_ex_decode(...)
 
utf_16_le_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
utf_16_le_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
utf_7_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
utf_7_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
 
utf_8_decode(...)
Decodes the object input and returns a tuple (output object, length consumed).
 
utf_8_encode(...)
Encodes the object input and returns a tuple (output object, length consumed).
Function Details [hide private]

decode(...)

 

decode(obj, [encoding[,errors]]) -> object

Decodes obj using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors raise a ValueError. Other possible values are 'ignore' and 'replace' as well as any other name registerd with codecs.register_error that is able to handle ValueErrors.

encode(...)

 

encode(obj, [encoding[,errors]]) -> object

Encodes obj using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors raise a ValueError. Other possible values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name registered with codecs.register_error that can handle ValueErrors.

register(search_function)

 

Register a codec search function. Search functions are expected to take one argument, the encoding name in all lower case letters, and return a tuple of functions (encoder, decoder, stream_reader, stream_writer).

register_error(errors, handler)

 

Register the specified error handler under the name errors. handler must be a callable object, that will be called with an exception instance containing information about the location of the encoding/decoding error and must return a (replacement, new position) tuple.