[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question about scm_{to,from}_locale_string()
From: |
Peter TB Brett |
Subject: |
Re: A question about scm_{to,from}_locale_string() |
Date: |
Sun, 12 Jun 2011 08:09:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Hello,
>
> Peter TB Brett <address@hidden> skribis:
>
>> All of our strings are encoded as UTF-8, but we can't use
>> scm_to_utf8_stringn() and scm_from_utf8_string() because they don't
>> exist in Guile 1.8.8 (which we're going to have to continue to support
>> for some time).
>>
>> The question, then, is whether using scm_{to,from}_locale_string() with
>> UTF-8 strings will "just work" in both Guile 1.8.8 and Guile 2.0.1 as
>> long as we make sure that the current locale is a UTF-8 locale?
>
> Yes, it should work.
>
> However, in Guile 2.0.x, you'd better use scm_{to,from}_utf8_string to
> avoid relying on the locale settings. You could use a configure check
> for that.
I've added a configure check that defines scm_{to,from}_utf8_string to
scm_{to,from}_locale_string if the former isn't available in libguile.
Seems to work okay.
Obviously there are some cases where we still use the locale functions
explicitly, e.g. parsing command-line arguments.
Thanks for your help.
Peter
--
Peter Brett <address@hidden>
Remote Sensing Research Group
Surrey Space Centre
pgpUtALvvyGFx.pgp
Description: PGP signature