From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Fix several POSIX functions to use the locale encoding Date: Sat, 07 May 2011 22:16:37 +0200 Message-ID: <87pqnufeqi.fsf@gnu.org> References: <87sjsyszok.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1304799428 7967 80.91.229.12 (7 May 2011 20:17:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 May 2011 20:17:08 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat May 07 22:17:04 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QInvw-0003iO-Jk for guile-devel@m.gmane.org; Sat, 07 May 2011 22:17:00 +0200 Original-Received: from localhost ([::1]:43833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QInvw-0003Jq-28 for guile-devel@m.gmane.org; Sat, 07 May 2011 16:17:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QInvt-0003Jl-2Y for guile-devel@gnu.org; Sat, 07 May 2011 16:16:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QInvr-0003Cw-Jp for guile-devel@gnu.org; Sat, 07 May 2011 16:16:57 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:53990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QInvr-0003Cq-ED for guile-devel@gnu.org; Sat, 07 May 2011 16:16:55 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QInvm-0003bt-M2 for guile-devel@gnu.org; Sat, 07 May 2011 22:16:50 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2011 22:16:50 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2011 22:16:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?iso-8859-1?Q?Flor=E9al?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:nWButEarGLreCsAtKMXonGygH7g= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12451 Archived-At: Hi Mark, Mark H Weaver 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’.