Re: Guile integration and UTF-8
[email protected] (Ludovic Courtès)
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Message-ID | <[email protected]> |
Paul Smith <[email protected]> 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’. _______________________________________________ Make-alpha mailing list [email protected] https://lists.gnu.org/mailman/listinfo/make-alpha