Python module to register all supported iconv codecs
Project description
This module will register GNU iconv supported codecs for usage inside python.
- Usage:
Just register the codec you want:
>>> import iconv_codecs >>> iconv_codecs.register('ansi_x3.110-1983')
Then you can use it:
>>> u'testing'.encode('ansi_x3.110-1983') 'testing'
Alternatively you can use them without registering, by using the iconv prefix:
>>> '\x87'.decode('iconv:CP860') u'\xe7' >>> u'testing'.encode('iconv:CSEBCDICFISEA') '\xa3\x85\xa2\xa3\x89\x95\x87'
To register all python unsupported codecs, just call register() without parameters:
>>> iconv_codecs.register() >>> u'\xe7'.encode('utf32') '\xff\xfe\x00\x00\xe7\x00\x00\x00'
That will poll iconv for a list of codecs it supports and register the ones python doesn’t support already.
You can read full API documentation here: http://packages.python.org/iconv_codecs/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iconv_codecs-0.2a1.tar.gz
(3.5 kB
view details)
File details
Details for the file iconv_codecs-0.2a1.tar.gz
.
File metadata
- Download URL: iconv_codecs-0.2a1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4b467137b9e0507c5d27d0e936dc0dd04d252d28ab25e24df605cfbdca3e5008
|
|
MD5 |
e314a0e209a0deacc43277388eb400b3
|
|
BLAKE2b-256 |
b9884b56284e9c0871d3e2bd98642b99825df8e3984fa478b631aca4d0573c58
|