From avodonosov at yandex.ru Mon Jul 14 13:41:06 2008 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Mon, 14 Jul 2008 16:41:06 +0300 Subject: [trivial-utf-8-devel] error on sbcl Message-ID: <5610159171.20080714164106@yandex.ru> Hello. The following code when used with SBCL signals an error: (defparameter *body* #(110 115 58 104 116 116 112 58 47 47 115 112 101 99 115 46 111 112 101 110 105 100 46 110 101 116 47 97 117 116 104 47 50 46 48)) (trivial-utf-8:utf-8-bytes-to-string *body*) Invalid byte at start of character: 0xB8 [Condition of type UTF-8-DECODING-ERROR] Backtrace: 0: (TRIVIAL-UTF-8::UTF-8-STRING-LENGTH #) 1: (UTF-8-BYTES-TO-STRING #) ... With CLISP all is ok, the string is decoded as ns:http://specs.openid.net/auth/2.0 Best regards, -Anton From marijnh at gmail.com Mon Jul 14 14:19:40 2008 From: marijnh at gmail.com (Marijn Haverbeke) Date: Mon, 14 Jul 2008 16:19:40 +0200 Subject: Fwd: [trivial-utf-8-devel] error on sbcl In-Reply-To: References: <5610159171.20080714164106@yandex.ru> Message-ID: Hi Anton, The problem seems to be that I'm using too high an optimisation setting, which causes SBCL to go ahead and assume you are passing in a vector of unsigned bytes, while you are not. (trivial-utf-8:utf-8-bytes-to-string (coerce *body* '(unsigned-byte 8))) does work as it should. I'll see if I can make it check the type of its argument. Anyway, I've updated the library, if you re-download it your first example should work. (Hm, maybe I should start doing versions.) Best, Marijn On Mon, Jul 14, 2008 at 3:41 PM, Anton Vodonosov wrote: > Hello. > > The following code when used with SBCL signals an error: > > (defparameter *body* > #(110 115 58 104 116 116 112 58 47 47 > 115 112 101 99 115 46 111 112 101 110 > 105 100 46 110 101 116 47 97 117 116 > 104 47 50 46 48)) > > (trivial-utf-8:utf-8-bytes-to-string *body*) > > Invalid byte at start of character: 0xB8 > [Condition of type UTF-8-DECODING-ERROR] > > Backtrace: > 0: (TRIVIAL-UTF-8::UTF-8-STRING-LENGTH #) > 1: (UTF-8-BYTES-TO-STRING #) > ... > > With CLISP all is ok, the string is decoded as > ns:http://specs.openid.net/auth/2.0 > > Best regards, > -Anton > > _______________________________________________ > trivial-utf-8-devel mailing list > trivial-utf-8-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/trivial-utf-8-devel > From avodonosov at yandex.ru Mon Jul 14 14:47:36 2008 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Mon, 14 Jul 2008 17:47:36 +0300 Subject: [trivial-utf-8-devel] error on sbcl In-Reply-To: References: <5610159171.20080714164106@yandex.ru> Message-ID: <1211593758.20080714174736@yandex.ru> Hello Marijn. It works, thank you very much. -Anton on Monday, July 14, 2008, 5:15:10 PM Marijn wrote: > Anyway, I've updated the library, if you re-download it your first > example should work. (Hm, maybe I should start doing versions.) > Best, > Marijn > On Mon, Jul 14, 2008 at 3:47 PM, Marijn Haverbeke wrote: >> Hi Anton, >> >> The problem seems to be that I'm using too high an optimisation >> setting, which causes SBCL to go ahead and assume you are passing in a >> vector of unsigned bytes, while you are not. >> (trivial-utf-8:utf-8-bytes-to-string (coerce *body* '(unsigned-byte >> 8))) does work as it should. I'll see if I can make it check the type >> of its argument. >> >> Best, >> Marijn >> >> On Mon, Jul 14, 2008 at 3:41 PM, Anton Vodonosov wrote: >>> Hello. >>> >>> The following code when used with SBCL signals an error: >>> >>> (defparameter *body* >>> #(110 115 58 104 116 116 112 58 47 47 >>> 115 112 101 99 115 46 111 112 101 110 >>> 105 100 46 110 101 116 47 97 117 116 >>> 104 47 50 46 48)) >>> >>> (trivial-utf-8:utf-8-bytes-to-string *body*) >>> >>> Invalid byte at start of character: 0xB8 >>> [Condition of type UTF-8-DECODING-ERROR] >>> >>> Backtrace: >>> 0: (TRIVIAL-UTF-8::UTF-8-STRING-LENGTH #) >>> 1: (UTF-8-BYTES-TO-STRING #) >>> ... >>> >>> With CLISP all is ok, the string is decoded as >>> ns:http://specs.openid.net/auth/2.0 >>> >>> Best regards, >>> -Anton >>> >>> _______________________________________________ >>> trivial-utf-8-devel mailing list >>> trivial-utf-8-devel at common-lisp.net >>> http://common-lisp.net/cgi-bin/mailman/listinfo/trivial-utf-8-devel >>> >>