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: string port encodings Date: Tue, 15 Jan 2013 15:36:11 +0100 Message-ID: <87wqvems2s.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358260590 13050 80.91.229.3 (15 Jan 2013 14:36:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 14:36:30 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 15 15:36:48 2013 Return-path: Envelope-to: guile-devel@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 1Tv7d9-00062y-TV for guile-devel@m.gmane.org; Tue, 15 Jan 2013 15:36:48 +0100 Original-Received: from localhost ([::1]:45208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv7ct-00061L-Bc for guile-devel@m.gmane.org; Tue, 15 Jan 2013 09:36:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv7ck-0005z4-8J for guile-devel@gnu.org; Tue, 15 Jan 2013 09:36:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv7cd-0000IF-TY for guile-devel@gnu.org; Tue, 15 Jan 2013 09:36:22 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:40093 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv7cd-0000Ht-Os for guile-devel@gnu.org; Tue, 15 Jan 2013 09:36:15 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 5F98EB88F for ; Tue, 15 Jan 2013 09:36:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-type; s=sasl; bh=w zljnkQgMRsANQiD9OlhREIleUs=; b=FKrmkAkc2ofglY+PV1rUTRxhtmK2NlGI4 0oOqz92fcZumFpXIoOoR1nCJmKfS0VH8vnVR5hkk31xh73fOAatr/CnYwa6eVP1B 8m3L4pyA+9M3rbBOSacCZfpSdvh5lkYaNd/ga4FvgtqXeE6ZR1Vwss9ZqAOm6qvg JvILZf03qg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:mime-version:content-type; q=dns; s=sasl; b=G7o CXhShd7vfhyFU8d1/Cw9/NjRjF4OfHkOkl9tuaMRQpAuO8QRL4jHIyPExZqufuse Uz+tX8PBkwzU0o1pzMMw4FJkdwNTWSDsdvm72Af+NBeMhErdWyzz4cWzDtOHADI5 HA0FqvsIDIR7bt2hVq+rYcT6Fr2oRHtNRj7bxRGI= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 99B92B88E for ; Tue, 15 Jan 2013 09:36:14 -0500 (EST) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 206EAB88D for ; Tue, 15 Jan 2013 09:36:14 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: E9EABE9A-5F20-11E2-9CB0-0A4F0E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 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:15427 Archived-At: Quiz: what does this do? (define (f s) (with-output-to-string (lambda () (display s)))) When called with a string, what should it do? Like (f "foo"). If you answered, "return the string", that's what I would think it should do. But no, currently the answer is locale-specific. It encodes the string according to the current locale, then decodes it from that encoding. If your locale can't encode the string, tough luck for you! This is a bit crazy. Surely the port should be textual? Surely the default encoding for a string port should be utf-8 or something that can actually handle all strings? Andy -- http://wingolog.org/