unicode to string conversion

Skip Montanaro skip at pobox.com
Thu May 8 14:24:33 EDT 2003


    Luca> I would like to translate

    Luca> 	u'questa \xe8 bella'
    Luca> into
    Luca> 	'questa è bella'

    Luca> and put the result into a new variable

I love easy questions!

    >>> u = u'questa \xe8 bella'
    >>> s = u.encode("iso-8859-1")
    >>> print s
    questa è bella

Skip





More information about the Python-list mailing list