Unicode 3 digit decimal conversion
Klaus Alexander Seistrup
spam at magnetic-ink.dk
Sat Sep 27 04:54:24 EDT 2003
Rune Hansen wrote:
> >>> unicode("Gratis øl","iso-8859-1")
> u'Gratis \xf8l'
> >>>ord("\xf8")
> 248
>
> What I need is the converted string to read u'Gratis \248l' (*
> How do I do this without going through each and every character
> of the string?
How about
#v+
>>> print unicode('Gratis øl', 'iso-8859-1').encode('utf-8')
Gratis øl
>>>
#v-
// Klaus
--
><> unselfish actions pay back better
More information about the Python-list
mailing list