From: Peter TB Brett <peter@peter-b.co.uk>
To: guile-user@gnu.org
Subject: Re: A question about scm_{to,from}_locale_string()
Date: Sun, 12 Jun 2011 08:09:03 +0100 [thread overview]
Message-ID: <m3zklnmsq8.fsf@harrington.peter-b.co.uk> (raw)
In-Reply-To: 87tybw1meh.fsf@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
ludo@gnu.org (Ludovic Courtès) writes:
> Hello,
>
> Peter TB Brett <peter@peter-b.co.uk> 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 <peter@peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2011-06-12 7:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 10:13 A question about scm_{to,from}_locale_string() Peter TB Brett
2011-06-11 14:19 ` Ludovic Courtès
2011-06-12 7:09 ` Peter TB Brett [this message]
2011-06-12 9:28 ` Thien-Thi Nguyen
2011-06-12 9:46 ` Peter TB Brett
2011-06-12 16:24 ` Thien-Thi Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3zklnmsq8.fsf@harrington.peter-b.co.uk \
--to=peter@peter-b.co.uk \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).