From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_{to,from}_locale_string Date: Thu, 17 Mar 2011 23:12:11 +0100 Message-ID: References: <453544.78973.qm@web37901.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300399946 6236 80.91.229.12 (17 Mar 2011 22:12:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2011 22:12:26 +0000 (UTC) Cc: guile-devel To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 17 23:12:20 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0LQZ-0000HB-Nb for guile-devel@m.gmane.org; Thu, 17 Mar 2011 23:12:19 +0100 Original-Received: from localhost ([127.0.0.1]:53214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0LQZ-0007Xg-15 for guile-devel@m.gmane.org; Thu, 17 Mar 2011 18:12:19 -0400 Original-Received: from [140.186.70.92] (port=48839 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0LQL-0007Wl-AH for guile-devel@gnu.org; Thu, 17 Mar 2011 18:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0LQK-0004Q6-4U for guile-devel@gnu.org; Thu, 17 Mar 2011 18:12:05 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:52859 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0LQK-0004Pq-1y for guile-devel@gnu.org; Thu, 17 Mar 2011 18:12:04 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 38F094DD0; Thu, 17 Mar 2011 18:13:38 -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=qotZKId+Fg+Ay0c8+3vQey0++cU=; b=kSrm+i 7C3nooIgPp2c2reT56hhMIjkav9ByV1kaBLpflD8UqcsLTlHhcD/GcIEisNyJG60 jV29ZniJ4eiaq4eDIEIh8etQS/q1m7RImMb06lY24g1cFviIPyRXj1Ihj/gkoSe5 +yVBEDZtme7DU9kETaiXwp1SOZGvDk5tRjLuA= 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=WD8gZApvtw2zHmDvmuSD5pg2IbDEjIjy 2Zxvi3VYtT3IG9mOUPJfPajeFlzdr/rEjqWPq7LE0GU8O26t8XnM76C3XcVneKS0 /MyvtM5TSksxddIMdIcl8q+IhZzJ8SR6dQ8lvmFDkkOHWiaMvQ9kCZW2lcWKNvKy wZFTqAm2CUo= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 274F04DCE; Thu, 17 Mar 2011 18:13:36 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 88F9B4DCD; Thu, 17 Mar 2011 18:13:34 -0400 (EDT) In-Reply-To: <453544.78973.qm@web37901.mail.mud.yahoo.com> (Mike Gran's message of "Thu, 17 Mar 2011 11:38:12 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: CDBF75AA-50E3-11E0-BA15-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11897 Archived-At: Evening, On Thu 17 Mar 2011 19:38, Mike Gran writes: > So, if have a CGI script where the stdout could have one > a couple of different encodings based on a web client's language > preference settings, but, where the CGI program is running in a "C" > or "en_US.utf8" locale, this might count. The thing is that we need to be giving the C library strings encoded in the current locale, not the locale of any particular port, because that's how library functions will decode the strings internally -- take the regexec case, for example, recently fixed. I think that if the CGI script wants to read or write in a particular locale, either you set the LC_ALL/LC_CTYPE vars, do a setlocale in the Guile script, or set the encoding on a port. But that's port encodings, not something related to scm_{to/from}_locale_string, I don't think... Of course, in the CGI context, the encoding of any _environment variables_ is another thorny question, but not one that should depend on port encodings. Regards, Andy -- http://wingolog.org/