[plt-scheme] Why do MzScheme ports not respect the locale's encoding by default?

From: Michael Sperber (sperber at informatik.uni-tuebingen.de)
Date: Sat Feb 26 09:27:03 EST 2005

>>>>> "Jim" == Jim Blandy <jimb at redhat.com> writes:

Jim> Alex Shinn <foof at synthcode.com> writes:

>> Intuitively the port has a character encoding that takes effect when
>> you perform character-level operations, and is ignored when you
>> perform binary operations.  It may be hard to implement, but not to
>> use.

Jim> It's hard to implement, and to use.

That depends pretty much exclusively on what the underlying
abstractions for ports are.  I've recently implemented Alex's idea in
Scheme 48---it's very easy to implement there.  I don't see how it
could be "hard to use."

Jim> But you try it.  The first word of your paragraph is "intuitively".
Jim> Write us a nice tight description of exactly how interleaved character
Jim> and byte read operations behave that makes no assumptions about the
Jim> encoding beyond those made by ISO C, but allows the user to always
Jim> predict the next byte that will be read given any sequence of input
Jim> bytes in any character encoding, and any interleaving of byte and
Jim> character reads.  This is a description which, if it can be written,
Jim> ought to be in SRFI 56 anyway, so it's no waste of time either way.

I think ISO C is an unfortunate reference, as the underlying character
representation is encoding-dependent (as I understand it, at least),
which it isn't in PLT Scheme.  Once you fix the character semantics, a
whole lot of prooblems go away.

I may have gotten confused about what the focus of this discussion is
along the way---if so, I'd appreciate a little help :-)

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Posted on the users mailing list.