Re: Mixing characters and bytes
Alex Shinn 26 Aug 2005 01:46 UTC
On 8/26/05, Michael Sperber <xxxxxx@informatik.uni-tuebingen.de> wrote:
>
> Alex Shinn <xxxxxx@gmail.com> writes:
>
> > On 8/25/05, Michael Sperber <xxxxxx@informatik.uni-tuebingen.de> wrote:
> >>
> >> The string ports specified in SRFI 6 can support byte operations
> >> perfectly meaningfully. I believe SRFI 68 contains a variation of it.
> >
> > This is difficult to use in a Scheme that puts tight restrictions on
> > its strings, such as requiring them to be valid UTF-8, or if it performs
> > character-level semantic operations such as automatically
> > normalizing all strings.
>
> If you feed a string output port a bad encoding, sure you get bad
> data. This is a matter of specifying what happens in that case, which
> the SRFI does.
I don't see where the SRFI specifies what happens in this case.
However, it isn't just about bad encodings, but about string semantics.
It's much easier to perform automatic normalization if you only have to
work at the character level.
--
Alex