I wanted to try out printing some utf8 text to the console, but I ran into some issues. This is my program:
CHICKEN
(c) 2008-2019, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.1.0 (rev 8e62f718)
mingw32-windows-gnu-x86 [ dload ptables ]
; loading test-utf.scm ...
; loading c:/chicken/lib/chicken/11/
utf8.import.so ...
Note: re-importing already imported identifier: string-length
Note: re-importing already imported identifier: string-ref
Note: re-importing already imported identifier: string-set!
Note: re-importing already imported identifier: make-string
Note: re-importing already imported identifier: string
Note: re-importing already imported identifier: substring
Note: re-importing already imported identifier: string->list
Note: re-importing already imported identifier: list->string
Note: re-importing already imported identifier: string-fill!
Note: re-importing already imported identifier: write-char
Note: re-importing already imported identifier: read-char
Note: re-importing already imported identifier: display
Note: re-importing already imported identifier: print
Note: re-importing already imported identifier: print*
; loading c:/chicken/lib/chicken/11/utf8.so ...
; loading c:/chicken/lib/chicken/11/regex.so ...
; loading c:/chicken/lib/chicken/11/utf8-lolevel.so ...
őŐűŰ
As you can see, it prints
┼æ┼É┼▒┼░ instead of őŐűŰ. When I write a similar program in C# it does it correctly by default. It seems that the (import utf8) has no effect at all, because if I comment out the (import utf8) line and run it, then I get the same exact weird output.
What am I doing wrong? How can I properly work with strings that contain non-English characters? (Btw the file is saved with UTF-8 encoding and I'm using Windows.)