mņ &U²Ic@sÓdkZdkZdklZdZdZdZdZdZ hdeee f<deee f<d eee f<d eee f<d eee f<d eee f<d eee f<deee f<deee f<deee f<deee f<de e e f<deee f<deee f<dee df<dee df<dee e f<deee f<deedf<de edfAdd character set properties to the global registry. charset is the input character set, and must be the canonical name of a character set. Optional header_enc and body_enc is either Charset.QP for quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for the shortest of qp or base64 encoding, or None for no encoding. SHORTEST is only valid for header_enc. It describes how message headers and message bodies in the input charset are to be encoded. Default is no encoding. Optional output_charset is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method Charset.convert() is called. The default is to output in the same character set as the input. Both input_charset and output_charset must have Unicode codec entries in the module's charset-to-codec mapping; use add_codec(charset, codecname) to add codecs the module does not know about. See the codecs module's documentation for more information. s!SHORTEST not allowed for body_encN(tbody_enctSHORTESTt ValueErrort header_enctoutput_charsettCHARSETStcharset(RRRR((t*/data/zmath/lib/python2.4/email/Charset.pyt add_charset_s cCs|t|RB(R)RFRDRE((Rtfrom_splittables   cCs|ip|iS(sReturn the output character set. This is self.output_charset if that is not None, otherwise it is self.input_charset. N(R)RR&(R)((Rtget_output_charset)scCsŃ|iƒ}|itjo"tii|ƒt |ƒt Sn|it jo"ti i |ƒt |ƒt Sn^|itjoCtii|ƒ}ti i |ƒ}t||ƒt |ƒt Sn t |ƒSdS(s/Return the length of the encoded header string.N(R)RHtcsetR/R*temailt base64MIMEt base64_lenR=tlentMISC_LENR:t quopriMIMEtheader_quopri_lenRtlenb64tlenqptmin(R)R=RIRRRQ((Rtencoded_header_len1s ""cCs÷|iƒ}|o|i|ƒ}n|itjotii ||ƒSn§|it joti i ||ddƒSnz|it joetii|ƒ}ti i|ƒ}||jotii ||ƒSqóti i ||ddƒSn|SdS(sEHeader-encode a string, optionally converting it to output_charset. If convert is True, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the high-level Header class to deal with these issues. convert defaults to False. The type of encoding (base64 or quoted-printable) will be based on self.header_encoding. t maxlinelenN(R)RHRIR?R=R/R*RJRKt header_encodeR:ROR+RRLRQRPRR(R)R=R?RIRRRQ((RRV@s   cCsj|o|i|ƒ}n|itjotii|ƒSn)|itjoti i|ƒSn|SdS(sÉBody-encode a string and convert it to output_charset. If convert is True (the default), the string will be converted from the input charset to output charset automatically. Unlike header_encode(), there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on self.body_encoding. N( R?R)R=R0R*RJRKt body_encodeR:RO(R)R=R?((RRW_s (t__name__t __module__t__doc__tDEFAULT_CHARSETR3R4t__repr__R7R8R<R?RCtTrueRGRHRTtFalseRVRW(((RR$s +           (temail.base64MIMERJtemail.quopriMIMEtemail.EncodersR;R:R*RRNR[R+RRR"RR R#R$(R:RR[R;R#R*RNR"R RR$RJRR((Rt?s   ’o Ģ!