March 2003
Intermediate to advanced
656 pages
39h 30m
English
setdefaultencoding
setdefaultencoding(name)Sets the default codec used to encode and decode Unicode and string
objects (normally 'ascii').
setdefaultencoding is meant to be called only from
sitecustomize.py during startup; the
site module removes this attribute from
sys. You can call reload(sys)
to make this attribute available again, but this is not considered
good programming practice. Unicode, codecs, encoding, and decoding
are covered in Chapter 9. The
site and sitecustomize modules
are covered in Chapter 13.
Read now
Unlock full access