[gambit-list] Character encoding and the repl

Atticus atticus0 at posteo.org
Fri May 29 14:12:40 EDT 2015


First and formost thanks for developing and maintaining gambit.

As a beginner I'm a litte confused about the handling of the character
encoding in the repl. 

$ gsi -:d,t8,f8
$> "ü"

$> (string-ref "ü" 0)

$> (string->list "über")
(#\xfc #\b #\e #\r)

$> (with-output-to-file "test2" (lambda () (##write-string "ü")
$> ,q

$ cat test2

$ gsi -:d,t8,f8
$> (with-input-from-file "test2" (lambda () (read-char)))

With racket:

$ racket

$> (with-input-from-file "test2" (lambda () (read-char)))

$> (string->list "über")
'(#\ü #\b #\e #\r)

Why does gambit return "\374" instead of "ü" in the repl when evaluating
the string "ü"? I'm curious because in racket the repl returns the
evaluated string as "ü"", also read-char in racket returns #\ü instead
of #\xfc.

Looking at the documentation I could change the behaviour with:
     (output-port-readtable (repl-output-port))

Are there any advantages for having this default readtable setting in
gambit? As a beginner I think it's confusing.

More information about the Gambit-list mailing list