On 27. Jun 2005, at 16:23, Ivan Boldyrev wrote:
> 1. iso-8859-5 doesn't cover all codes #x00-#xff, there is "window" of
> undefined characters at #x80-#x9F. How should I signal about wrong
> codes at IN-EXPR clause of DEFINE-EXTERNAL-FORMAT?
signal a stream-decoding-error (fd-stream.lisp line 117 or
thereabouts). If an attempt is made to write a chinese character to
your iso-8859-5 stream, signal a stream-encoding-error. Appropriate
restarts are provided for these conditions in stream functions.
> 2. Can I use in fd-stream.lisp functions that are defined in
> octets.lisp? Otherwise I'll have to duplicate conversion code.
Yes; if it builds, it's fine. (Don't let anyone stop you from
unifying the stream / alien string-to-octets-and-back functionality,
either :) )
> 3. Is the following patch fine? With it, I can declare iso-8859-5 in
> this way:
Looks fine, if it doesn't break any other encodings. Be sure to
resend it with the other patches so it doesn't get lost.
ObNikodemus: it would be nice to have some encoding tests (similar to
what NIIMI Satoshi did in tests/eucjp-impure.lisp), to make sure your
work isn't broken during the eventual reorganization of external-
format code. Maintainers get a stern look and a slap on the wrist
when checking in code with failing tests, but a regression in one of
the lesser-used encodings might slip in unnoticed.