Lines Matching refs:encode
154 built-in, or to the encode() method of a Unicode string.
165 return string.encode('ascii', 'surrogateescape')
167 return string.encode(codec)
223 input_charset.encode('ascii')
285 """Header-encode a string by converting it first to bytes.
291 to encode this string to bytes using the character set's
304 """Header-encode a string by converting it first to bytes.
310 to encode this string to bytes using the character set's
329 # Now comes the hard part. We must encode bytes but we can't split on
332 # encode to bytes to figure out this word's length, but you must split
381 """Body-encode a string by converting it first to bytes.
393 string = string.encode(self.output_charset)
398 # this is so, see changeset 0cf700464177. To correctly encode a
400 # latin1 charset, which will encode any byte as a single code point
403 string = string.encode(self.output_charset)
408 string = string.encode(self.output_charset).decode('ascii')