GNU bug report logs -
#10627
char-ready? is broken for multibyte encodings
Previous Next
Reported by: Mark H Weaver <mhw <at> netris.org>
Date: Sat, 28 Jan 2012 10:24:02 UTC
Severity: normal
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Sat 28 Jan 2012 11:21, Mark H Weaver <mhw <at> netris.org> writes:
> The R5RS specifies that if 'char-ready?' returns #t, then the next
> 'read-char' operation is guaranteed not to hang. This is not currently
> the case for ports using a multibyte encoding.
>
> 'char-ready?' currently returns #t whenever at least one _byte_ is
> available. This is not correct in general. It should return #t only if
> there is a complete _character_ available.
This procedure is omitted in the R6RS because it is not a good
interface. Besides its semantic difficulties, can you think of a sane
implementation for multibyte characters?
I suggest we document that this procedure only works correctly in
encodings with 1-byte characters and recommend that people use u8-ready?
instead.
Andy
--
http://wingolog.org/
This bug report was last modified 8 years and 340 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.