make-alpha
[Top][All Lists]
Advanced

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

Re: Guile integration and UTF-8


From: Ludovic Courtès
Subject: Re: Guile integration and UTF-8
Date: Wed, 25 Sep 2013 18:26:19 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Paul Smith <address@hidden> skribis:

> On Tue, 2013-09-24 at 23:11 +0200, Ludovic Courtès wrote:
>> The fix would be to convert the string passed to $(guile ...) from a
>> fixed encoding, rather than from the current locale encoding.  For
>> instance:
>> 
>>   scm_eval_string (scm_from_utf8_string (argv[0]))
>
> Hm.  Right now I'm trying to allow support for both Guile 1.8 and 2.0.
> Of course, scm_from_utf8_string() doesn't exist in Guile 1.8.  I tried
> using plain scm_from_locale_string() but that didn't work either; I
> guess I haven't set up the locale properly from Guile's point of view.

Guile 1.8 has no notion of encoding, so strings are just byte strings
like in C.

When you get a UTF-8 string containing nuls with 1.8, that string gets
in as is.  The nuls then appear as non-printable, leading to the failure
we’ve seen in gmk-default.mk.

> What are your thoughts about supporting Guile 1.8?  It still seems
> widely distributed so I'd hate to drop it unless there are good reasons.

Well, 1.8 is essentially unmaintained.

If the costs of supporting it are low, then go ahead.  They’re probably
low in fact, but some features like Unicode support will be missing, so
you’ll have to document it.

For the above, you could AC_CHECK_FUNCS([scm_from_utf8_string]), and:

  #ifdef HAVE_SCM_FROM_UTF8_STRING
    scm_eval_string (scm_from_utf8_string (argv[0]));
  #else /* Guile 1.8 */
    scm_c_eval_string (argv[0]);
  #endif

HTH,
Ludo’.



reply via email to

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