On 5/20/07, Andrei Stebakov lispercat@gmail.com 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:
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%5C ">
<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head><title>UTF-8 test file</title></head> <body> <p>Original by Markus Kuhn, adapted for HTML by Martin Dürst.</p> <pre> UTF-8 encoded sample plain-text file
debugger invoked on a SB-INT:STREAM-ENCODING-ERROR in thread #<THREAD "initial t hread" {BBDF5A9}>: encoding error on stream #<SB-SYS:FD-STREAM for "standard output" {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 #<SB-SYS:FD-STREAM for "standard output" {BBDF859}>
^^^^^^^^^^^^^^^
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.