unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Startup locale and environ_locale_charset
@ 2019-04-28  5:22 Mike Gran
  2019-04-28 17:25 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Gran @ 2019-04-28  5:22 UTC (permalink / raw)
  To: guile-devel

Starting in the 2.2.x series, the Guile executable calls
setlocale(LC_ALL,"") on startup except when the GUILE_INSTALL_LOCALE
environment variable is set to '0'.

This leads to a call to scm_shell that converts command line arguments
to Guile strings using the current locale.  But in doing so, it calls
a function environ_locale_charset() that presumes that setlocale
hasn't been called.  This appears to be obsolete, and probably be
replaced with just a call to gnulib's locale_charset().

It is a bit of an issue because it would prevent a possible future
update to gnulib, which no longer provides the get_charset_aliases()
procedure on which environ_locale_charset() has depended.

If there is no objection, I'd like to remove environ_locale_charset().

But doing this would theoretically lead to a user-visible change.  If
there were a user that had set the GUILE_INSTALL_LOCALE environment
variable to zero, intentionally bringing up Guile in the "C" locale,
but, still relied on Guile parsing non-ASCII command line arguments in
the environment's LANG-specified locale, it might lead to a different
behavior.

I'm fairly certain that this corner case would never occur in real
life.  A search-engine search on GUILE_INSTALL_LOCALE reveals no cases
of anyone having set it to zero.

What do you think?

-Mike Gran



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

* Re: Startup locale and environ_locale_charset
  2019-04-28  5:22 Startup locale and environ_locale_charset Mike Gran
@ 2019-04-28 17:25 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2019-04-28 17:25 UTC (permalink / raw)
  To: Mike Gran; +Cc: guile-devel

Hi Mike,

Mike Gran <spk121@yahoo.com> writes:

> Starting in the 2.2.x series, the Guile executable calls
> setlocale(LC_ALL,"") on startup except when the GUILE_INSTALL_LOCALE
> environment variable is set to '0'.
>
> This leads to a call to scm_shell that converts command line arguments
> to Guile strings using the current locale.  But in doing so, it calls
> a function environ_locale_charset() that presumes that setlocale
> hasn't been called.  This appears to be obsolete, and probably be
> replaced with just a call to gnulib's locale_charset().
>
> It is a bit of an issue because it would prevent a possible future
> update to gnulib, which no longer provides the get_charset_aliases()
> procedure on which environ_locale_charset() has depended.
>
> If there is no objection, I'd like to remove environ_locale_charset().

Sounds good to me, go ahead.  The comment above the only use of
'environ_locale_charset' also makes it clear that the plan was to remove
this hack before 2.2.

> But doing this would theoretically lead to a user-visible change.  If
> there were a user that had set the GUILE_INSTALL_LOCALE environment
> variable to zero, intentionally bringing up Guile in the "C" locale,
> but, still relied on Guile parsing non-ASCII command line arguments in
> the environment's LANG-specified locale, it might lead to a different
> behavior.

I'm not worried about it, but I appreciate your attention to detail!

      Thanks,
        Mark



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

end of thread, other threads:[~2019-04-28 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-28  5:22 Startup locale and environ_locale_charset Mike Gran
2019-04-28 17:25 ` Mark H Weaver

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