[Lispweb] encoding error on stream
Alan Shields
Alan-Shields at omrf.ouhsc.edu
Fri May 13 11:02:01 CDT 2005
On Thu, May 12, 2005 at 11:42:01PM +0200, rm at fabula.de wrote:
> On Thu, May 12, 2005 at 04:06:24PM -0500, Alan Shields wrote:
> > On Tue, May 10, 2005 at 02:56:16PM +0200, rm at fabula.de wrote:
> > > On Mon, May 09, 2005 at 03:22:18PM -0500, Alan Shields wrote:
> > > > Hey folks,
> > > >
> > > > An issue has cropped up that I'm not quite sure how to deal with.
> > > >
> > > > I'm trying to send a JPEG as a response in araneida. I've been doing
> > > > this for a while. However, with SBCL 0.9.0, I started getting this
> > > > error:
> > > >
> > > > "encoding error on stream"
> > >
> > > Welcome to the club ;-/
> >
> > Looks like this might have been fixed in a recent patch.
> >
> > 0.9.0.24
> > Don't silently assume LATIN-1 for unknown / misspelled
> > :external-format argument
>
> I fear it's a bit more complicated - and IMHU unfortunately not realy a
> "bug" . In Common Lisp a stream has (one!) external format and an element
> type. Now, when you open the socket with an :external-format of :utf-8 you
> won't be able to send binary data (like images etc.) This is bad for an
> HTTP/1.1 server where a connection can be used for both text and image data
> without reopening. If opened with an element type of '(unsigned-byte 8) you
> can't really do (format stream .....) type of output ... Since HTTP makes
> heavy use of MIME data can be in all sorts of external formats send over
> the same (unsigned-byte 8) stream.
>
> > from the commit logs.
> >
> > Until Debian updates, I think I'll keep running my app on my PPC
> > laptop.
>
> Lucky you. I had quite some fights on our production box :-/
Earlier on, I read that information you pointed me to. Would it be
possible to set up the socket with '(unsigned-byte 8) and use an echo
stream with an :external-format of :utf-8 to do the text writing?
Alan
More information about the lispweb
mailing list