[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UTF8 crashes http-server (was Re: [Chicken-users] Spiffy is crashing
Re: UTF8 crashes http-server (was Re: [Chicken-users] Spiffy is crashing)
Wed, 15 Apr 2009 22:55:15 +0200
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)
#;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)
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.
"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
Description: PGP signature