Summary

Error in the utf8 egg's substring=?

Metadata

Description

First found it using tab-completion in csi:

 Error: (substring=?) out of range
 3
 0
 3
 
 	Call history:
 
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc
 	utf8-srfi-13.scm:374: proc	  	<--

This is seen in the egg's tests as well: http://salmonella-linux-x86.call-cc.org/master/clang/linux/x86/2024/04/11/salmonella-report/test/utf8.html (chicken-install's exit code is 0, I'm not seeing why -- there's a test-begin at the top and a test-end at the bottom -- though this is another problem):

 (string-prefix? "元麻布" "麻布十番" 1) ........................ [ERROR]
 
 Error: (substring=?) out of range
 6
 0
 6
 (string-prefix? "元麻布" "麻" 1 2) ............................... [ERROR]
 
 Error: (substring=?) out of range
 3
 0
 3

It's almost certain these errors are related to the recent changes made to substring=? and friends: https://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=commit;h=0e97b648407d750f1e476e3c193e136126558346

Changes and comments

[2024-04-16 01:08:56 UTC] felix changed status from assigned to closed

[2024-04-16 01:08:56 UTC] felix set resolution to fixed

[2024-04-23 18:22:21 UTC] siiky changed status from closed to reopened

[2024-04-23 18:22:21 UTC] siiky removed resolution fixed

[2024-04-23 18:22:21 UTC] siiky wrote:

 
 I believe the problem is in the lines {{{(##sys#check-range start1 0 (##sys#size s1) 'substring=?)}}}, when the string is empty -- it amounts to {{{(##sys#check-range 0 0 0 'substring=?)}}}.
 
 I can't tell what the obvious fix is, if there is one. Return {{{#t}}} if one of the strings is empty?

[2024-04-23 18:22:21 UTC] siiky wrote:

1713889386331621

[2026-07-04 22:30:44 UTC] felix wrote:

CHICKEN 6 has full unicode support, the utf8 egg may be incomplete but works decently enough.

[2026-07-04 22:30:45 UTC] felix changed status from reopened to closed

[2026-07-04 22:30:45 UTC] felix set resolution to wontfix