[Python-Dev] RE: Ill-defined encoding for CP875?

Tim Peters tim.one@home.com
Wed, 16 May 2001 03:14:25 -0400


[MAL]
> Round-tripping is obviously very important if you use Unicode
> as basis for working on text.

Since I use 7-bit ASCII exclusively, I've been using

    encode = decode = lambda x: x

I haven't proved that's round-trippable, but haven't bumped into an exception
yet.

> I don't know about the reasoning behind making cp875 fail the
> round-trip -- Unicode certainly provides means to make mappings
> round-trip safe (e.g. by reverting to the private Unicode
> char. point areas).

Then I ignorantly but confidently (indeed, with the cheery confidence only
the truly ignorant can truly enjoy!) vote for your approach that maps the
non-round-trippable cp875 code points to None.  Better safe than sorry, by
default.  Else 6 of the 7 ambiguous chars will be silent surprises by
default.