unicode 3 digit decimal conversion

Rune Hansen rune.hansen at viventus.no
Sat Sep 27 04:05:55 EDT 2003


Hi,
I've got the string "Gratis øl",or in english:"Free beer",  I know there 
is no such thing but...

Python 2.3 (#1, Aug  1 2003, 15:23:03)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 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?
(not that I have figgured out how to do that right either)

regards

/rune
*) I need to communicate with a telnet interface that only accepts 
accented characters as unicode decimals





More information about the Python-list mailing list