l...@gnu.org (Ludovic Courtès) writes:
> David Kastrup <d...@gnu.org> skribis:
>
>> Shouldn't strings be in "internal encoding" anyway?  The whole point of
>> a string is to be an array of characters.  Not an array of arbitrarily
>> encoded bytes.
>
> Yes, but I was referring to “string ports”, which may actually be fed
> arbitrary binary data, not just characters.

For the record, I agree with David.  String ports should be textual
ports, not binary ports.  In particular, you should be able to
write/read _any_ character to/from a string port, regardless of what the
current default port encoding happens to be.

SRFI-6 (string ports) says nothing about port encodings, and yet
portable code written for SRFI-6 will fail on Guile 2.0 unless the
string is constrained to whatever the default port encoding happens to
be.  This is not just a theoretical issue; it has caused trouble in
practice, e.g.:

  http://bugs.gnu.org/11197

Unfortunately, we are now in an awkward situation.  The current behavior
of Guile 2.0 is conceptually broken and breaks portable SRFI-6 code, and
yet it is possible that some users have grown to depend on our current
behavior.

     Mark

Reply via email to