[I18n-sig] JapaneseCodecs 1.1 with ISO-2022-JP codec

M.-A. Lemburg mal@lemburg.com
Fri, 24 Nov 2000 23:47:49 +0100

Tamito KAJIYAMA wrote:
> One question: is there a requirement that a codec must be able
> to deal with encodings (e.g. UTF-16LE) other than the intended
> encoding (e.g. EUC-JP)? 

No. Where did you get that impression from ? A codec is only
require to handle (at least) one encoding. It may use fallback
solutions and thus allow more than one encoding to be decoded,
but encoding should not produce more than one possible output.

> BTW, in the SourceForge Patch Manager there was a patch for
> fixing the problem exactly described in the quotation above:
> http://sourceforge.net/patch/?func=detailpatch&patch_id=101477&group_id=5470
> The sender of this patch was me (I did not have the SourceForge
> account when I posted it).

I read that patch, but IMHO it doesn't go all the way. See the
patch page for details. What we'd need is some buffering code
in the UTF-16 codec. It would then read UTF-16 and do the line
breaking using .splitlines() or a similar technique which supports
all Unicode line break characters.

BTW, your email address bounces...

Marc-Andre Lemburg
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/