[Tutor] character format
Tony Meyer
tameyer at ihug.co.nz
Thu May 12 03:42:55 CEST 2005
> You mean é? Oh, it is perfectly printable. It's even on my
> keyboard (as unshifted 2), along with è, ç, à and ù. Ah, American
> cultural assumption... ^^
>From the email address, chances are that this was a New Zealand cultural
assumption. Ah, the French, lumping all English speakers under the American
banner <wink>.
Anyway, the explanation was right, if the label wasn't. They are simply
hexidecimal representations of characters.
Denise: there are many uses for this - to know what you need to do, we need
to know what you are trying to do. Where are you finding these characters?
Are they in a file? If so, what type of file is it, and what do you want to
do with the file? Those questions are more likely to lead you to the module
you're after.
I believe Max's guess was that the file is compressed with bzip (the first
two characters will be BZ, as you found). Try doing:
>>> import bz2
>>> print bz2.decompress(data)
Where data is a string containing the characters you have. (Although you
say that compression is unlikely, the BZ characters would be a big
co-incidence).
=Tony.Meyer
More information about the Tutor
mailing list