unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* A question about scm_{to,from}_locale_string()
@ 2011-06-11 10:13 Peter TB Brett
  2011-06-11 14:19 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Peter TB Brett @ 2011-06-11 10:13 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

Hi folks,

gEDA currently uses scm_to_locale_string() and scm_from_locale_string()
to convert C char* strings to and from SCM strings.

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?

Thanks in advance,

                           Peter

-- 
Peter Brett <peter@peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about scm_{to,from}_locale_string()
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2011-06-11 14:19 UTC (permalink / raw)
  To: guile-user

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.

Thanks,
Ludo'.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about scm_{to,from}_locale_string()
  2011-06-11 14:19 ` Ludovic Courtès
@ 2011-06-12  7:09   ` Peter TB Brett
  2011-06-12  9:28     ` Thien-Thi Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Peter TB Brett @ 2011-06-12  7:09 UTC (permalink / raw)
  To: guile-user

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about scm_{to,from}_locale_string()
  2011-06-12  7:09   ` Peter TB Brett
@ 2011-06-12  9:28     ` Thien-Thi Nguyen
  2011-06-12  9:46       ` Peter TB Brett
  0 siblings, 1 reply; 6+ messages in thread
From: Thien-Thi Nguyen @ 2011-06-12  9:28 UTC (permalink / raw)
  To: Peter TB Brett; +Cc: guile-user

() Peter TB Brett <peter@peter-b.co.uk>
() Sun, 12 Jun 2011 08:09:03 +0100

   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.

Probably sooner or later it behooves us (clients of libguile)
to hold a libguile "portability summit", where common bits of
autoconfigury, shimming, etc can be actively pooled, refactored
and (hopefully) incorporated into a time-saving tarball.

In this way, stuff like the autoconf check you mention, and
stuff like Autogen's or Serveez's C shims can be centrally
maintained and not re-invented time and time again.

____________________________________________________________________
[0] or "pit of despair", depending on your mood :-/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about scm_{to,from}_locale_string()
  2011-06-12  9:28     ` Thien-Thi Nguyen
@ 2011-06-12  9:46       ` Peter TB Brett
  2011-06-12 16:24         ` Thien-Thi Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Peter TB Brett @ 2011-06-12  9:46 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> Probably sooner or later it behooves us (clients of libguile)
> to hold a libguile "portability summit", where common bits of
> autoconfigury, shimming, etc can be actively pooled, refactored
> and (hopefully) incorporated into a time-saving tarball.
>
> In this way, stuff like the autoconf check you mention, and
> stuff like Autogen's or Serveez's C shims can be centrally
> maintained and not re-invented time and time again.

That sounds to me like you volunteering to organise one. :-) I'd
certainly be interesting taking part!

                         Peter

-- 
Peter Brett <peter@peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about scm_{to,from}_locale_string()
  2011-06-12  9:46       ` Peter TB Brett
@ 2011-06-12 16:24         ` Thien-Thi Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2011-06-12 16:24 UTC (permalink / raw)
  To: Peter TB Brett; +Cc: guile-user

() Peter TB Brett <peter@peter-b.co.uk>
() Sun, 12 Jun 2011 10:46:14 +0100

   That sounds to me like you volunteering to organise one. :-) I'd
   certainly be interesting taking part!

My organizational skills are probably not what this kind of project
needs, but in any case, here's My Roadmap (dates are deadlines):

- 2011-07-15
  choose name for project

- 2011-07-23
  make github or non-gnu.savannah project

- 2011-08-01
  populate project w/ metainfo (README, HACKING, doc/PROJECT.texi)

- 2011-08-08
  import various bits from Guile-PG, Guile-SDL, GNU Serveez,
  munging them to conform to the attributes espoused in README

- 2011-08-15
  invite others to do the same, in the process tweaking the
  attributes espoused in README and the already-imported bits

- 2011-09-01
  develop tools to instantiate the bits from some abstract template,
  selecting only those used/useful in the downstream user-project

- 2011-10-01
  release PROJECT-1.0.tar.bz2

If anyone beats me to it, i am certainly not going to mind.
(The drawn out nature of the dates gives a hint how little!)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-12 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-06-12  9:28     ` Thien-Thi Nguyen
2011-06-12  9:46       ` Peter TB Brett
2011-06-12 16:24         ` Thien-Thi Nguyen

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).