converting u'11\xa022' to '11\xa022'

Laurent Pointal laurent.pointal at limsi.fr
Wed Feb 21 04:24:55 EST 2007


Gabriel Genellina a écrit :
> En Wed, 21 Feb 2007 00:31:32 -0300, alf <ask at me.xs4all.nl> escribió:

>>     2-list of supported encodings?
> I don't know how to query the list, except by reading the documentation
> for the codecs module.

>>> from encodings import aliases
>>> aliases.aliases
{'iso_ir_6': 'ascii', '1140': 'cp1140', 'tis620': 'tis_620', 'iso8859':
'latin_1', 'chinese': 'gb2312', 'mskanji': 'cp932', 's_j
is': 'shift_jis', 'iso_celtic': 'iso8859_14', 'ebcdic_cp_wt': 'cp037',
<zip (this is a big dict)>
'utf_16_be', 'latin3': 'iso8859_3', 'iso_ir_148': 'iso88
59_9', 'ebcdic_cp_ca': 'cp037', 'tis_620_0': 'tis_620'}
>>> enc = aliases.aliases.keys()
>>> enc
['iso_ir_6', '1140', 'tis620', 'iso8859', 'chinese', 'mskanji', 's_jis',
'iso_celtic', 'ebcdic_cp_wt', 'csibm863', 'ebcdic_cp_he
', 'csHPRoman8', 'cp936', 'iso_8859_5_1988', 'maccyrillic', 'csibm857',
<zip>
', 'iso_8859_11_2001', 'latin8', 'greek', '8859', 'big5_hkscs',
'iso_ir_144', 'unicodebigunmarked', 'latin3', 'iso_ir_148', 'ebc
dic_cp_ca', 'tis_620_0']
>>>


Note: this include some encodings like 'quotedprintable', 'zip', 'zlib'...







More information about the Python-list mailing list