~ chicken-core (master) 44b56dcdd239d42f9f40541790a76c27f0435247


commit 44b56dcdd239d42f9f40541790a76c27f0435247
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Sat Oct 17 19:05:38 2026 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Sat Oct 17 19:05:38 2026 +0200

    write-char writes 0-character, for backwards compatibility
    
    (reported by Stanislav Kljuhhin)

diff --git a/utf.c b/utf.c
index a899c8b6..990849e4 100644
--- a/utf.c
+++ b/utf.c
@@ -632,6 +632,10 @@ next:
 C_regparm void C_utf_putc(int chr, C_FILEPTR fp)
 {
     C_char buf[ 5 ];
+    if(chr < 128) {
+        C_fputc(chr, fp);   // just to preserve compatibility to C5
+        return;
+    }
     C_char *p = utf8_encode(chr, buf);
     *p = '\0';
     C_fputs(buf, fp);
Trap