Unicode - and MIMEType - Good friday fun.

bouncyinc at gmail.com bouncyinc at gmail.com
Sat Sep 12 04:09:16 CEST 2009


How do you suppose it should work....and how is it working? what about the outpout difference?

----------
Sent via Cricket Mobile Email

------Original Message------
From: rh0dium <steven.klass at gmail.com>
To: <python-list at python.org>
Date: Fri, 11 Sep 2009 04:33:42 PM -0700
Subject: Unicode - and MIMEType - Good friday fun.

Hi Geniuses,

Can anyone please show me the way..  I don't understand why this
doesn't work...


# encoding: utf-8
from email.MIMEText import MIMEText

msg = MIMEText("hi")
msg.set_charset('utf-8')
print msg.as_string()

a = 'Ho\xcc\x82tel Ste\xcc\x81phane '
b = unicode(a, "utf-8")

print b

msg = MIMEText(b)
msg.set_charset('utf-8')
print msg.as_string()

It should right??

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list