Lines Matching defs:encoding
110 return "<%s.%s object for encoding %s at %#x>" % \
127 decoding and '?' on encoding.
130 character reference (only for encoding).
133 (only for encoding).
148 make encoding efficient.
184 remembers the state of the encoding process between calls to encode().
341 # interfaces which can be used to implement new encoding submodules
474 definition of the encoding and the given size, e.g. if
475 optional encoding endings or state markers are available
679 encoding = 'unknown'
757 """ StreamRecoder instances translate data from one encoding to another.
871 def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
874 a wrapped version providing transparent encoding/decoding.
881 If encoding is not None, then the
885 encoding specifies the encoding which is to be used for the
890 encoding error occurs.
897 .encoding which allows querying the used encoding. This
898 attribute is only available if an encoding was specified as
902 if encoding is not None and \
907 if encoding is None:
911 info = lookup(encoding)
914 srw.encoding = encoding
923 encoding translation.
937 encoding error occurs.
958 def getencoder(encoding):
960 """ Lookup up the codec for the given encoding and return
963 Raises a LookupError in case the encoding cannot be found.
966 return lookup(encoding).encode
968 def getdecoder(encoding):
970 """ Lookup up the codec for the given encoding and return
973 Raises a LookupError in case the encoding cannot be found.
976 return lookup(encoding).decode
978 def getincrementalencoder(encoding):
980 """ Lookup up the codec for the given encoding and return
983 Raises a LookupError in case the encoding cannot be found
987 encoder = lookup(encoding).incrementalencoder
989 raise LookupError(encoding)
992 def getincrementaldecoder(encoding):
994 """ Lookup up the codec for the given encoding and return
997 Raises a LookupError in case the encoding cannot be found
1001 decoder = lookup(encoding).incrementaldecoder
1003 raise LookupError(encoding)
1006 def getreader(encoding):
1008 """ Lookup up the codec for the given encoding and return
1011 Raises a LookupError in case the encoding cannot be found.
1014 return lookup(encoding).streamreader
1016 def getwriter(encoding):
1018 """ Lookup up the codec for the given encoding and return
1021 Raises a LookupError in case the encoding cannot be found.
1024 return lookup(encoding).streamwriter
1026 def iterencode(iterator, encoding, errors='strict', **kwargs):
1035 encoder = getincrementalencoder(encoding)(errors, **kwargs)
1044 def iterdecode(iterator, encoding, errors='strict', **kwargs):
1053 decoder = getincrementaldecoder(encoding)(errors, **kwargs)
1076 """ Creates an encoding map from a decoding map.