From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: Re: command line argument locale for a guile script Date: Tue, 8 Nov 2011 03:16:54 +0800 Message-ID: References: <20111107105922.3512144f@rascar> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf3079bfeed40c8504b129e54e X-Trace: dough.gmane.org 1320693425 774 80.91.229.12 (7 Nov 2011 19:17:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 19:17:05 +0000 (UTC) To: cong gu , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 07 20:17:01 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RNUgm-0007jX-IH for guile-user@m.gmane.org; Mon, 07 Nov 2011 20:17:00 +0100 Original-Received: from localhost ([::1]:47179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNUgm-0004BI-3o for guile-user@m.gmane.org; Mon, 07 Nov 2011 14:17:00 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNUgi-0004B2-FA for guile-user@gnu.org; Mon, 07 Nov 2011 14:16:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNUgh-0005II-6U for guile-user@gnu.org; Mon, 07 Nov 2011 14:16:56 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:53478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNUgh-0005IC-0P for guile-user@gnu.org; Mon, 07 Nov 2011 14:16:55 -0500 Original-Received: by vcbfo13 with SMTP id fo13so1799631vcb.0 for ; Mon, 07 Nov 2011 11:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KmezlasJYMYRtG1wh+X7XGb/Q6KZ9taK8Yn8fQJfSK4=; b=MDTL7qvGi5U1U5eNfo1HQB44VAsKQBEr8fajn1J/6X1AXwyuy+wG64mumfOoDCcMVv 2gNvGG5uKbxC4JPVczPeMcaujDx41BwvqpFmRd6P06M6SAHkJ91vxWIrzLEOE/v/gsEF a73D+xh7A702zOPIslSLxZ+8npT+d5/yGFVbA= Original-Received: by 10.52.36.109 with SMTP id p13mr27824930vdj.59.1320693414497; Mon, 07 Nov 2011 11:16:54 -0800 (PST) Original-Received: by 10.52.188.69 with HTTP; Mon, 7 Nov 2011 11:16:54 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8940 Archived-At: --20cf3079bfeed40c8504b129e54e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Nov 7, 2011 at 11:31 PM, cong gu wrote: > On Mon, Nov 7, 2011 at 6:59 AM, David Pirotte wrote: > > You must also set port encoding, see manual section 6.14.1 for details: > > > > (set-port-encoding! (current-output-port) "utf-8") > > > > Thanks for responding. > > But after a setlocale, utf-8 output is already fine. The problem is > argument parsing still not work for non-ascii characters. > > #!/usr/bin/guile > !# > (setlocale LC_ALL "") > (set-port-encoding! (current-input-port) "utf-8") > (set-port-encoding! (current-output-port) "utf-8") > (write "=E8=B7=AA=E4=BA=86") ;; fine > (write (command-line)) ;; not work > > > After I add a setlocale to boot-9.scm, all things works. But is there > a "normal" way to fix this? > > hi, we've talked about this problem and we think it's a real bug. I sent a patch just now, it is solved. You may see it work soon. --20cf3079bfeed40c8504b129e54e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Nov 7, 2011 at 11:31 PM, cong gu <gucong43216@gmail.c= om> wrote:
On Mon, Nov 7, 2011 at 6:59 AM, David Pirotte <david@altosw.be> wrote:
> You must also set port encoding, see manual section 6.14.1 for details= :
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(set-port-encoding! (current-output-port) &= quot;utf-8")
>

Thanks for responding.

But after a setlocale, utf-8 output is already fine. =C2=A0The problem is argument parsing still not work for non-ascii characters.

#!/usr/bin/guile
!#
(setlocale LC_ALL "")
(set-port-encoding! (current-input-port) "utf-8")
(set-port-encoding! (current-output-port) "utf-8")
(write "=E8=B7=AA=E4=BA=86") ;; fine
(write (command-line)) ;; not work


After I add a setlocale to boot-9.scm, all things works. =C2=A0But is there=
a "normal" way to fix this?


hi, we've talked about this problem and we = think it's a real bug.
I sent a patch just now, it is solved.= You may see it work soon.


--20cf3079bfeed40c8504b129e54e--