Lines Matching refs:bstring
89 def encode_q(bstring):
90 return ''.join(_q_byte_map[x] for x in bstring)
92 def len_q(bstring):
93 return sum(len(_q_byte_map[x]) for x in bstring)
138 def encode_b(bstring):
139 return base64.b64encode(bstring).decode('ascii')
141 def len_b(bstring):
142 groups_of_3, leftover = divmod(len(bstring), 3)
177 bstring = cte_string.encode('ascii', 'surrogateescape')
178 bstring, defects = _cte_decoders[cte](bstring)
181 string = bstring.decode(charset)
185 string = bstring.decode(charset, 'surrogateescape')
187 string = bstring.decode('ascii', 'surrogateescape')
222 bstring = string.encode('ascii', 'surrogateescape')
224 bstring = string.encode(charset)
226 qlen = _cte_encode_length['q'](bstring)
227 blen = _cte_encode_length['b'](bstring)
230 encoded = _cte_encoders[encoding](bstring)