[Python-Dev] Unicode howto in the works - feedback appreciated

Barry A. Warsaw barry@zope.com
Wed, 1 May 2002 13:59:12 -0400


[Email]

A Stephen Turnbull says, if there's no charset, you must assume it's
us-ascii.  Here's an (untested) example using the email package:

    import email

    msg = email.message_from_string(...)
    if msg.get_main_type() == 'text':
	charset = msg.get_param('charset', 'us-ascii')
    else:
	charset = NotAppropriate

-Barry