guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix several POSIX functions to use the locale encoding


From: Ludovic Courtès
Subject: Re: [PATCH] Fix several POSIX functions to use the locale encoding
Date: Sat, 07 May 2011 22:16:37 +0200
User-agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux)

Hi Mark,

Mark H Weaver <address@hidden> writes:

> In particular: `system*', `execl', `execlp', `execle', `environ', and
> `dynamic-args-call' use scm_i_allocate_string_pointers to convert a list
> of SCM strings into an argv-style array of C strings.  That function
> does a simple memcpy for narrow strings, and throws an exception for
> wide strings (via scm_i_string_chars).
>
> `environ' was particularly broken, in that it would use Latin-1 when
> setting the environment, and the locale encoding when reading the
> environment.  The `exec' functions would use the locale encoding to
> encode the program name, and Latin-1 for the arguments and environment.
> `system*' would use Latin-1 for everything.

Ouch, good catch!

> This patch fixes all of these inconsistencies, by modifying
> scm_i_allocate_string_pointers to use the locale encoding instead of
> Latin-1.
>
> Any objections to pushing this to stable-2.0?

Not from me, please go ahead!

It would be ideal if you could add a test case, say, for ‘system*’ and
‘environ’.  You could use the ‘with-latin1-locale’ tricks.

Thanks,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]