R: unicode to string conversion

Luca Calderano calderano at sgaspa.it
Fri May 9 03:22:34 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

    Skip>I love easy questions!

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


maybe i have mispelled my problem ....

I would like to transform the unicode string:

	u= u'più'

into an usual string:

	s = 'più'

Luca






More information about the Python-list mailing list