• Home
  • Raw
  • Download

Lines Matching refs:charset

20 from email import charset as _charset
77 return [(_charset._encode(string, str(charset)), str(charset))
78 for string, charset in header._chunks]
97 charset = parts.pop(0).lower()
100 words.append((encoded, encoding, charset))
114 for encoded_string, encoding, charset in words:
117 decoded_words.append((encoded_string, charset))
120 decoded_words.append((word, charset))
130 decoded_words.append((word, charset))
137 for word, charset in decoded_words:
142 last_charset = charset
143 elif charset != last_charset:
146 last_charset = charset
170 for s, charset in decoded_seq:
172 if charset is not None and not isinstance(charset, Charset):
173 charset = Charset(charset)
174 h.append(s, charset)
180 def __init__(self, s=None, charset=None, argument
209 if charset is None:
210 charset = USASCII
211 elif not isinstance(charset, Charset):
212 charset = Charset(charset)
213 self._charset = charset
217 self.append(s, charset, errors)
233 for string, charset in self._chunks:
240 nextcs = charset
265 def append(self, s, charset=None, errors='strict'): argument
286 if charset is None:
287 charset = self._charset
288 elif not isinstance(charset, Charset):
289 charset = Charset(charset)
291 input_charset = charset.input_codec or 'us-ascii'
298 output_charset = charset.output_codec or 'us-ascii'
305 charset = UTF8
306 self._chunks.append((s, charset))
358 for string, charset in self._chunks:
362 if not hasspace or charset not in (None, 'us-ascii'):
364 elif charset not in (None, 'us-ascii') and not lastspace:
367 lastcs = charset
371 formatter.feed('', lines[0], charset)
373 formatter.feed('', '', charset)
376 if charset.header_encoding is not None:
378 charset)
382 formatter.feed(fws, sline, charset)
399 for string, charset in self._chunks:
400 if charset == last_charset:
406 last_charset = charset
443 def feed(self, fws, string, charset): argument
449 if charset.header_encoding is None:
459 encoded_lines = charset.header_encode_lines(string, self._maxlengths())