[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UTF8 crashes http-server (was Re: [Chicken-users] Spiffy is crashing
From: |
address@hidden |
Subject: |
Re: UTF8 crashes http-server (was Re: [Chicken-users] Spiffy is crashing) |
Date: |
Wed, 15 Apr 2009 22:55:15 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Apr 15, 2009 at 02:09:12PM +0200, address@hidden wrote:
> FWIW, I traced the problem to http-server. Even the simple example on
> the wiki breaks when utf8 is loaded. I will look deeper into this
> tonight (at work right now...), but I mention this in case anyone is
> reading along and wants to look at it.
The problem is in UTF8's string-search-positions procedure:
#;1> (use regex)
; loading library regex ...
#;2> (string-search-positions "a" "b" 0)
#f
#;3> (use utf8)
; loading /usr/pkg/lib/chicken/3/utf8.scm ...
; loading /usr/pkg/lib/chicken/3/utf8-support.so ...
; loading /usr/pkg/lib/chicken/3/utf8-lolevel.so ...
; loading /usr/pkg/lib/chicken/3/byte-string.so ...
#;4> (string-search-positions "a" "b" 0)
((-1 -1))
It's the -1 that's unexpected, since it's not a valid string index,
so trying to do anything with that causes it to fail big time.
It should just return #f on non-matching stuff. Still not sure what
exactly causes this, though.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
pgp48a6O5ENSH.pgp
Description: PGP signature