From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#20823: argv mangled by locale Date: Fri, 24 Jun 2016 08:11:29 +0200 Message-ID: <87a8ibjeum.fsf@pobox.com> References: <20150616043300.GB2718@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466750992 12589 80.91.229.3 (24 Jun 2016 06:49:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 06:49:52 +0000 (UTC) Cc: 20823@debbugs.gnu.org, Zefram To: mhw@netris.org, ludo@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jun 24 08:49:39 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGKvp-00063X-Jj for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 08:49:37 +0200 Original-Received: from localhost ([::1]:41335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKvl-0004lK-J1 for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 02:49:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKLW-0002jN-W0 for bug-guile@gnu.org; Fri, 24 Jun 2016 02:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGKLR-0001iB-S2 for bug-guile@gnu.org; Fri, 24 Jun 2016 02:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKLR-0001i6-Oh for bug-guile@gnu.org; Fri, 24 Jun 2016 02:12:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGKLR-0006j2-Ly for bug-guile@gnu.org; Fri, 24 Jun 2016 02:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 24 Jun 2016 06:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20823 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 20823-submit@debbugs.gnu.org id=B20823.146674870025823 (code B ref 20823); Fri, 24 Jun 2016 06:12:01 +0000 Original-Received: (at 20823) by debbugs.gnu.org; 24 Jun 2016 06:11:40 +0000 Original-Received: from localhost ([127.0.0.1]:53238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGKL6-0006iR-IE for submit@debbugs.gnu.org; Fri, 24 Jun 2016 02:11:40 -0400 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:64440 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGKL5-0006iK-0y for 20823@debbugs.gnu.org; Fri, 24 Jun 2016 02:11:39 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id B543B26CA5; Fri, 24 Jun 2016 02:11:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=UV9FTdXROGLoOAt41LFbiVTtxWM=; b=CWUTHs vrPSkAn+2UOB0cNDnGvEIqjNUUhAbpTJfuyguTqztyeIAXev1W6CL6gGjJzrU65/ 6UWNN61fDGDieDEOV6biuTAoFV8jZHpkoJLv4LsLezX5MSZOUiA+ksST34xk72lZ QImalIrotsvpREUrkCzlvHrPr5mBvu+BM3/Lc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=vOpER5KUHWi2QvuDUIq+gdtt6lDR4NYJ 2L1MIZWfuNwGowgLVNZARLvqmfLGTjgPZQeToy2xuNO6ZbgDnVG3pPqnueFTPo5o 17ANNjwve+zAb70aCD3ESsGackLwP55h8Qg8R5M89jaKZsFNna6AredTdac0ns7Z HQDR5YTXL64= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id AE31726CA4; Fri, 24 Jun 2016 02:11:37 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 0B81126CA3; Fri, 24 Jun 2016 02:11:36 -0400 (EDT) In-Reply-To: <20150616043300.GB2718@fysh.org> (zefram@fysh.org's message of "Tue, 16 Jun 2015 05:33:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 8233A74A-39D2-11E6-A7F8-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8198 Archived-At: On Tue 16 Jun 2015 06:33, Zefram writes: > I don't see any Scheme interface that reliably retrieves the command > line arguments without locale decoding. [...] > The actual data passed between processes is an octet string, and > there really needs to be some reliable way to access that octet string. > My comments about resolution in bug#20822 "environment mangled by locale" > mostly apply here too, with a slight change: it seems necessary to store > the original octet strings and decode at the time program-arguments is > called. With that change, the decoding can be responsive to setlocale > (and in particular can reliably use ISO-8859-1 in the absence of > setlocale). Proposal: scm_i_set_boot_program_arguments just copies the bytes, and scm_program_arguments decodes them. I don't know whether to save the locale that was current at program start and use that locale to decode the arguments, or default the current locale, or what. I also don't know whether to supply an optional "encoding" argument, and use that encoding to decode the command line arguments. Thoughts, Mark and Ludovic? Andy