[gambit-list] Some UTF-8 support issues.

Ramil Farkhshatov ramil at gmx.co.uk
Mon Sep 7 11:42:04 EDT 2009


On Mon, Sep 07, 2009 at 11:13:07AM -0400, Marc Feeley wrote:
> > 1. WRITE and PP procedures output unicode (UTF-8 with nonlatin
> > characters) strings in such form:
> > 	"\uXXXX\uXXXX" ; when run with t8 option
> > 	"\XXX\XXX" ; when run without t8 option
> > Also procedures returning strings output in REPL acts in same manner.

> I don't get this behavior with v4.5.1.  Which version are you using?

I observed that since v4.3.2 (the version I started using gambit) till
v4.5.1. DISPLAY procedure works fine though.

> You can change the readtable's "max-unescaped-char" attribute:
> 
> (define (set-no-escapes-for-unicode! port)
>   (output-port-readtable-set!
>    port
>    (readtable-max-unescaped-char-set
>     (output-port-readtable port)
>     (integer->char #x10ffff))))

Thank you.

> > (skipped)

> I'm not sure what should be the right behavior.  Currently, a
> latin-1 encoding will be used for the filenames.  There is very
> little code to change in the runtime system to use UTF-8 encoding
> for the filenames, but this means that filesystems using plain
> character (latin-1) encoding for filenames will stop working.  I
> could add a configure option, such as --enable-path-encoding=UTF-8 .
> But that begs the question: what's the right default?  Is the
> default OS dependent?

I think that current locale settings (locale(7)) should be used as
default value. And it should be calculated at start time rather than
compile time if possible, since locale settings can be changed (e.g.
per user).

-- 
Ramil Farkhshatov




More information about the Gambit-list mailing list