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#20822: environment mangled by locale Date: Fri, 24 Jun 2016 07:57:43 +0200 Message-ID: <87eg7njfhk.fsf@pobox.com> References: <20150616041736.GA2718@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466750440 4569 80.91.229.3 (24 Jun 2016 06:40:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 06:40:40 +0000 (UTC) Cc: 20822@debbugs.gnu.org, ludo@gnu.org To: Zefram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jun 24 08:40:30 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 1bGKmy-0006Op-JQ for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 08:40:28 +0200 Original-Received: from localhost ([::1]:41273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKmu-0002JM-Kn for guile-bugs@m.gmane.org; Fri, 24 Jun 2016 02:40:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGK7w-0003Sb-7e for bug-guile@gnu.org; Fri, 24 Jun 2016 01:58:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGK7u-000685-J1 for bug-guile@gnu.org; Fri, 24 Jun 2016 01:58:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGK7u-000681-FV for bug-guile@gnu.org; Fri, 24 Jun 2016 01:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGK7u-0006KW-58 for bug-guile@gnu.org; Fri, 24 Jun 2016 01:58:02 -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 05:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20822 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 20822-submit@debbugs.gnu.org id=B20822.146674787724318 (code B ref 20822); Fri, 24 Jun 2016 05:58:02 +0000 Original-Received: (at 20822) by debbugs.gnu.org; 24 Jun 2016 05:57:57 +0000 Original-Received: from localhost ([127.0.0.1]:53226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGK7o-0006K9-Mq for submit@debbugs.gnu.org; Fri, 24 Jun 2016 01:57:56 -0400 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:55740 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGK7m-0006Jz-0m for 20822@debbugs.gnu.org; Fri, 24 Jun 2016 01:57:55 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 80BFB26B92; Fri, 24 Jun 2016 01:57:52 -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=uAvPY3snXKgih0syRmBkl3nRjqQ=; b=CwaQMz 6ef532+YQJzwzBRAweBGUsReIvR/lqt1eGYviWb4Su8fXRdKNFy6wv0xO7XCFQk1 YnJDSrhHTYYmHXd+AmpoxSr39ihw1ifNrwMS2wUlHf9clA0YcWwjr1uqfRyHOmym ccW1Dp8D3FC4zGh6JCndsp/7Dbevm89miKZ/4= 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=rm+tyMZzamT4e8W84Y8/u4dh2WnzTBkK sN7Txc6/gVgtAXVF3cJ4x7HTXHbYZHCmqW+yZfaS25L/hlgKFsMw/8La3/OcGtpu +VzKzVc7QBYLNoyit70RgEx1OYcqOxUxdkBK6o/I1lwfSBB6j9cdbPot4/WI30kT YKCffEq/7YY= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 6A07426B91; Fri, 24 Jun 2016 01:57:52 -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 7E6C426B8F; Fri, 24 Jun 2016 01:57:51 -0400 (EDT) In-Reply-To: <20150616041736.GA2718@fysh.org> (zefram@fysh.org's message of "Tue, 16 Jun 2015 05:17:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 962A85CC-39D0-11E6-899B-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:8197 Archived-At: On Tue 16 Jun 2015 06:17, Zefram writes: > When guile-2.0 is asked to read environment variables, via getenv, > it always decodes the underlying octet string according to the current > locale's nominal character encoding. This is a problem, because the > environment variable's value is not necessarily encoded that way, and > may not even be an encoding of a character string at all. The decoding > is lossy, where the octet string isn't consistent with the character > encoding, so the original octet string cannot be recovered from the > mangled form. I don't see any Scheme interface that retrieves the > environment without locale decoding. Options: Add optional "encoding" arg to scm_getenv; encoding is a string Add alternate getenv interface that returns a bytevector We'll have to do the same for setenv too, I think. I think I would go with adding an encoding argument to getenv. WDYT Mark and Ludovic? Andy