From ehuels@gmail.com Sun May 20 11:02:27 2007 From: Erik Huelsmann To: drakma-devel@common-lisp.net Subject: Re: [drakma-devel] Help with utf-8 (SBCL 1.0.5) Date: Sun, 20 May 2007 17:02:18 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7173830090516276552==" --===============7173830090516276552== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 5/20/07, Andrei Stebakov wrote: > When I make the request like this: > (drakma:http-request > "http://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html") > > It results in error: > > " > \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\ > "> > > UTF-8 test file > >

Original by Markus Kuhn, adapted for HTML by Martin Dürst.

>
> UTF-8 encoded sample plain-text file
>
> debugger invoked on a SB-INT:STREAM-ENCODING-ERROR in thread # "initial t
> hread" {BBDF5A9}>:
>   encoding error on stream # {BBDF859}>
>   (:EXTERNAL-FORMAT :ASCII):
>     the character with code 8254 cannot be encoded.
>
>  Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
>
> restarts (invokable by number or by possibly-abbreviated name):
>   0: [OUTPUT-NOTHING] Skip output of this character.
>   1: [ABORT         ] Exit debugger, returning to top level.
>
> (SB-INT:STREAM-ENCODING-ERROR
>  #
                                    ^^^^^^^^^^^^^^^

>  8254)
> 0]
>
>
> Is it some parameter that I forgot to call http-request with to make it
> aware of utf-8 encoding?

No. SBCL has detected your terminal doesn't support the characters
you're trying to print, so, it's generating an error.  As you can see
a few lines higher up, the standard output file has an associated
encoding of ASCII, meaning that probably the output of 'locale' on
your system contains LANG=POSIX or LANG=C.

> Thank you,
> Andrew

HTH,

Erik.

--===============7173830090516276552==--