chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] UTF-8 support


From: Tobia Conforto
Subject: [Chicken-users] UTF-8 support
Date: Thu, 13 Dec 2007 13:46:30 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hello

I recently discovered (to my expense) that the default chicken
configuration is not Unicode-aware.  After digging a bit in the
documentation and mailing list archives though, I found out (to my joy)
that it can be made so by placing the following two directives before
anything else, or in .csirc for interactive usage.

        (use syntax-case utf8)
        (import utf8)
        (use ...everything else...)

As far as I could grasp they modify the behaviour of scheme primitives,
string functions and other eggs (such as regex), so that they operate on
UTF-8 strings internally and are fully Unicode-aware.

For example, the following fails without the directives and succeeds
with them, at least in a UTF-8 terminal / source code file:

        (string=? "à" (string (integer->char 224)))

Question: is this the recommended approach?

Suggestion: this is all probably quite obvious to Chicken veterans, but
it took a bit to discover, or to "stumble upon".  Could it be made a bit
more prominent, for example by placing in the FAQ?

Also, does anybody know whether and how is the 4th parameter of (regexp)
to be used?

In any case, many thanks to the authors of this excellent language.


Tobia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]