From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: Re: Unicode ports patch Date: Tue, 1 Sep 2009 12:19:49 -0700 (PDT) Message-ID: <935264.92888.qm@web37907.mail.mud.yahoo.com> References: <1251212782.18373.10335.camel@localhost.localdomain> <87hbvnnkl8.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1251832812 14111 80.91.229.12 (1 Sep 2009 19:20:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2009 19:20:12 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo , =?iso-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 01 21:20:04 2009 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.50) id 1MiYtf-0004fN-Jg for guile-devel@m.gmane.org; Tue, 01 Sep 2009 21:20:03 +0200 Original-Received: from localhost ([127.0.0.1]:39229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiYte-0001Vu-ST for guile-devel@m.gmane.org; Tue, 01 Sep 2009 15:20:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiYtX-0001Ut-Td for guile-devel@gnu.org; Tue, 01 Sep 2009 15:19:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiYtT-0001Uf-As for guile-devel@gnu.org; Tue, 01 Sep 2009 15:19:55 -0400 Original-Received: from [199.232.76.173] (port=59427 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiYtT-0001Uc-4z for guile-devel@gnu.org; Tue, 01 Sep 2009 15:19:51 -0400 Original-Received: from web37907.mail.mud.yahoo.com ([209.191.91.169]:36187) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MiYtS-00056S-Kg for guile-devel@gnu.org; Tue, 01 Sep 2009 15:19:50 -0400 Original-Received: (qmail 5023 invoked by uid 60001); 1 Sep 2009 19:19:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1251832789; bh=Uj/MHUY5jcFhq6J31vt20brVKJ0jC/GahxAY36Otvac=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5jSdciScq+HvSPgTz9CsXae9wjB8hwNxA94IytFWRVJ0V7v7kdVSm6TUEd4P2P5z3nRNQQ8m7iaI2JrB/BA1Uob09xqoDrkTuxCbANciRDrKSEvFgCnDwjmfBvWWeDzy2IXyAE8WTJ76Gcnq1kOsHO99QvYlVqO2mNfF9aRFKZE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=GCRbTerjr/dVpzM5VfkqTzqiEAFQaP7FheqKhLKIDuvMVKYxo0mO8uH7XxRiPIN8W8kAd00uobaqKuMJnxisPDfrTguAxvJjZ0U4hqjBx/C/gWnZtlPq8jDVlbRQX3sQG0VW1zwAhPqMyCSvFRe3qCD77SZPDejI/n/PEsqGdoM=; X-YMail-OSG: Uq0_lVEVM1mSvSMcC_AmtXMh7oFM1FxxkpPT4pOOJjb9m1HI.rzZ7D7eiHnit0uVr7ajWcEy.8_U_eUuIkHrheQ2c0F3MLms8P5o7rDgDNkfwzJ.I11gpxBfRbDyVCrDLpNeP6lZGEyrpSL87cG5mA1h_KMzRrBiHcYf7J6o6XW7WyCDkDmFxP5J9tKJib7ZFU4ELlh044ZPpo804_QAMtOIUXmgDgGlFeW_TNdKlerlsaSZYghMiEkt0EbvWCd46Z_.0NEHu4Xod7ep6UMTxAfaGjOqUkwDODQVQLNt95x7XYGy.L5gyaoA7hR5uw07Fw-- Original-Received: from [207.8.91.2] by web37907.mail.mud.yahoo.com via HTTP; Tue, 01 Sep 2009 12:19:49 PDT X-Mailer: YahooMailRC/1358.27 YahooMailWebService/0.7.338.2 In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) 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:9234 Archived-At: ----- Original Message ----=0A> From: Andy Wingo =0A> To: = Ludovic Court=E8s =0A> Cc: guile-devel@gnu.org=0A> Sent: Tues= day, September 1, 2009 11:25:26 AM=0A> Subject: Re: Unicode ports patch=0A>= =0A> Hi,=0A> =0A> On Tue 01 Sep 2009 10:19, ludo@gnu.org (Ludovic Court=E8= s) writes:=0A> =0A> > Mike Gran writes:=0A> >=0A> >> The latest commit 'Add= full Unicode capability to ports and the default=0A> >> reader' 889975e51a= ccb80491af76fc5db980aeb3edd342 adds the majority of=0A> >> the functionalit= y for non-ASCII strings.=A0 =0A> >=0A> > This patch adds a few functions re= lated to string ports:=0A> >=0A> >=A0 * libguile/strports.c: store string p= orts in locale encoding=0A> >=A0 =A0 (scm_strport_to_locale_u8vector, scm_c= all_with_output_locale_u8vector)=0A> >=A0 =A0 (scm_open_input_locale_u8vect= or, scm_get_output_locale_u8vector):=0A> >=A0 =A0 new functions=0A> >=0A> >= I think it would be nicer if these used bytevectors instead of u8vectors= =0A> > and were locale-independent (which would match the `string->utf8' &= =0A> > co. API).=A0 Also I would make `scm_strport_to_locale_u8vector ()'= =0A> > private.=A0 And finally, it'd be even better if it were documented i= n the=0A> > manual.=A0 :-)=0A=0AI don't understand.=A0 "it would be nicer i= f *these* ..."=0A=0ATo what does *these* refer: string ports?=A0 It would b= e nicer if we replace=0Astring ports with bytevector ports?=A0 Or it would = be nicer if =0Ascm_get_output_locale_u8vector was scm_get_output_bytevector= ?=0A=0A"it would be nicer if these used bytevectors ... and were *locale-in= dependent*"=0A=0AIt would be nicer if string ports were actually bytevector= ports, and that =0Athey were locale-independent?=A0 Or that scm_get_output= _bytevector returned a =0Alocale-independent (ergo 8-bit or 32-bit) vector?= =0A=0A> >=0A> > Actually I'm not convinced that `call-with-output-locale-*'= and=0A> > `open-input-locale-*' are useful, precisely because we can use a= string=0A> > port to get a string and then `string->utf8' to get at the st= ring bits.=0A=0A"We can use a string port to get a string"=0A=0AIf we write= to a string port and pop a result string?=0A=0A"And then use string->utf8 = to get at the string bits"=0A=0AAnd then convert the result string to a UTF= -8 encoded bytevector?=0A=0A> =0A> FWIW, I think I agree with all of Ludovi= c's comments; though if there is=0A> a way that we can simply arrange to ou= tput bytes to an R6RS binary=0A> output port, I think there are already eff= icient means to collect the=0A> bytes from such a port in a bytevector.=0A= =0AThanks,=0AMike