[Python-Dev] _iconv_codec (original) (raw)

Hye-Shik Chang perky@fallin.lv
Mon, 24 Feb 2003 23:08:34 +0900


On Mon, Feb 24, 2003 at 08:08:13AM -0500, Guido van Rossum wrote:

Can anybody explain the point of the iconvcodec module to me? I see no docs for it, there's a continued stream of bug reports related to it. I've heard that it's a wrapper around some 3rd party library, but that doesn't help me -- I don't know anything about that 3rd party library module either.

--Guido van Rossum (home page: http://www.python.org/~guido/)

_iconv_codec wraps around iconv(3) function which is defined in POSIX. (http://www.opengroup.org/onlinepubs/007904975/functions/iconv.html) IMHO, we don't need docs for it because no user is expected to access _iconv_codec directly. It just provides a codec set interface to libiconv when python doesn't have standard codec for some encoding.

I feel that raising RuntimeError on init_iconv_codec is producing numerous bug reports. Because insane iconv(3) is fatal for iconv_codec but not for python, I think it should raise ImportError instead of RuntimeError.

To be honest, there're some minor problems on _iconv_codec that I know, currently. I'm working on an unified multibyte codec codebase for {zh,ja,ko,iconv}codecs nowadays. I guess that I can submit fully reimplemented versions of {zh,ko,iconv}codecs in a week. It will resolve most problems on now.

Sorry for immature status of _iconv_codec and I will do my best to make it stable before 2.3b1.

Thank you.

Regards,

Hye-Shik =)