From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cong gu Newsgroups: gmane.lisp.guile.user Subject: Re: command line argument locale for a guile script Date: Mon, 7 Nov 2011 09:31:49 -0600 Message-ID: References: <20111107105922.3512144f@rascar> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1320679926 23844 80.91.229.12 (7 Nov 2011 15:32:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 15:32:06 +0000 (UTC) Cc: guile-user@gnu.org To: David Pirotte Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 07 16:32:02 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 1RNRB4-0000pX-38 for guile-user@m.gmane.org; Mon, 07 Nov 2011 16:32:02 +0100 Original-Received: from localhost ([::1]:53421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNRB3-0005o9-K9 for guile-user@m.gmane.org; Mon, 07 Nov 2011 10:32:01 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:41067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNRAx-0005nw-92 for guile-user@gnu.org; Mon, 07 Nov 2011 10:31:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNRAs-0007df-EH for guile-user@gnu.org; Mon, 07 Nov 2011 10:31:55 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:34717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNRAs-0007dU-7B for guile-user@gnu.org; Mon, 07 Nov 2011 10:31:50 -0500 Original-Received: by vws16 with SMTP id 16so1023419vws.0 for ; Mon, 07 Nov 2011 07:31:49 -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 :cc:content-type:content-transfer-encoding; bh=mbE9F6Z8Oaqob6qvZa3H6Igv27cIl64IBt2bSWs3xTg=; b=W9b73noe8OlQD2UwWzp1Dgi7C7+Jpz1Za7/HUc9q3JqNzZIK7XlOjSDAHBWWi9Dt96 mi1lJyX5/xH9JTZlRBOKYfDcMymQW50lQo1cv/ff3mSmAGhUnLuA0AhJ9GKIaMWcA4wz SwX7/AEdy3OnMhrQIDDb0/8kVVkRS0PptHVXM= Original-Received: by 10.52.32.73 with SMTP id g9mr26665418vdi.125.1320679909603; Mon, 07 Nov 2011 07:31:49 -0800 (PST) Original-Received: by 10.220.162.3 with HTTP; Mon, 7 Nov 2011 07:31:49 -0800 (PST) In-Reply-To: <20111107105922.3512144f@rascar> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 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:8939 Archived-At: 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: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(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?