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: =?utf-8?q?Re=3A_=5BPATCH=5D_Have_string_ports_honor_=E2=80=98=25?= =?utf-8?q?default-port-encoding=E2=80=99?= Date: Mon, 4 Jan 2010 18:47:47 -0800 (PST) Message-ID: <217394.1649.qm@web37902.mail.mud.yahoo.com> References: <87pr5p9zg0.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262666515 24329 80.91.229.12 (5 Jan 2010 04:41:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2010 04:41:55 +0000 (UTC) To: =?utf-8?B?THVkb3ZpYyBDb3VydMOocw==?= , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 05 05:41:48 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from terminus-est.gnu.org ([66.92.78.210] helo=lists.gnu.org) by lo.gmane.org with esmtp (Exim 4.50) id 1NS1Eh-0002Pe-At for guile-devel@m.gmane.org; Tue, 05 Jan 2010 05:41:46 +0100 Original-Received: from localhost ([127.0.0.1]:43566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NS1EP-0005z9-Fs for guile-devel@m.gmane.org; Mon, 04 Jan 2010 23:41:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NS0x3-0002uE-G1 for guile-devel@gnu.org; Mon, 04 Jan 2010 23:23:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NS0wx-0002rS-Sv for guile-devel@gnu.org; Mon, 04 Jan 2010 23:23:24 -0500 Original-Received: from [199.232.76.173] (port=52767 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NS0Kc-0006wE-6W for guile-devel@gnu.org; Mon, 04 Jan 2010 22:43:42 -0500 Original-Received: from web37902.mail.mud.yahoo.com ([209.191.91.164]:41201) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NRzSZ-0007Mu-DL for guile-devel@gnu.org; Mon, 04 Jan 2010 21:47:52 -0500 Original-Received: (qmail 1680 invoked by uid 60001); 5 Jan 2010 02:47:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1262659668; bh=Shc+j9jhKlEcOKd4/yGGDl46vrc0WUnBarEUHBjUsBI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=oMUx//dlI1CNJNfx9Y9knsATParvDXQNbEjVdRSvWJ/bisf/9N10fGlsQ72NlWXpGy4al+PQeTnAryBWj/URhNnkxzCSoTb8QURXlyK7aIL4o94fFS3OBqeL2r314OfXxyJWHw1dfzx8d4hAOG7L6Uk4wWdV7vAEBR1PcxB1S6o= 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:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XN6frmuHT0bXskKdDeEt6UL7dwhKxMXcJOrzA+FEenMy6ZraSp8I/See6Ydq69l6RFnm5ZCHhwCv+PC8vJrMtQZLbTfPYsuzdZLsQMex/fMs0daB2ydqk01VhVt1O4OMfSn9LMiESwzOA43+4Zgo403Uf8Uni6Hh7BLsOnHM628=; X-YMail-OSG: tUOvaUoVM1k4BOs9jI7fKpZRlwtcm2yep1Bw.9wUuzIE5xw6J9i9SZJK Original-Received: from [207.8.91.2] by web37902.mail.mud.yahoo.com via HTTP; Mon, 04 Jan 2010 18:47:47 PST X-Mailer: YahooMailRC/240.3 YahooMailWebService/0.8.100.260964 In-Reply-To: <87pr5p9zg0.fsf@gnu.org> 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:9824 Archived-At: > From: Ludovic Court=C3=A8s =0A> =0A> Hello,=0A> =0A> The at= tached patch fixes string ports so that their encoding defaults to=0A> =E2= =80=98%default-port-encoding=E2=80=99 (as for other ports) instead of UTF-8= .=0A> =0A> Mike: can you review it?=0A=0AHi Ludovic, =0A=0AIt is a bit hard= for me to review this as I don't have access to my machine=0Aright now, bu= t, let me see what I can do.=0A=0AWhen you write...=0A=0A+=C2=A0 /* Create = a copy of STR in the encoding of Z.=C2=A0 */=0A+=C2=A0 buf =3D scm_to_strin= gn (str, &str_len, pt->encoding,=0A+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 SCM_FAILED_CONVERSION_ERROR);=0A+=C2=A0 /* FIXME: strdup= doesn't do the right thing if BUF contains zeros, but we=0A+=C2=A0 =C2=A0 = don't know the size in bytes of STR.=C2=A0 */=0A+=C2=A0 c_str =3D scm_gc_st= rdup (buf, "strport");=0A+=C2=A0 free (buf);=0A=0A... isn't the returned va= lue str_len the length in bytes of buf?=C2=A0 I think=0Ayou could avoid the= strdup call, since it could fail, for example,=C2=A0for=0AUTF-32 strings o= f more than one character.=0A=0AAlso, in the big scheme of things, I wonder= if the name "string port"=0Ais misleading now.=C2=A0 Strings can contain t= he whole codepoint range.=C2=A0 =0ABut string ports can't store the whole r= ange depending on their encoding.=0A(That's what the "UTF-8" hack was about= .)=0A=0AThanks,=0A=0AMike Gran