[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing characters and bytes



On 8/26/05, Michael Sperber <sperber@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> Alex Shinn <alexshinn@xxxxxxxxx> writes:
> 
> > On 8/25/05, Michael Sperber <sperber@xxxxxxxxxxxxxxxxxxxxxxxxxxx> 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