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: command line argument locale for a guile script Date: Sun, 6 Nov 2011 18:19:40 -0600 Message-ID: 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 1320625195 17848 80.91.229.12 (7 Nov 2011 00:19:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 00:19:55 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 07 01:19:48 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 1RNCwF-0006qW-6c for guile-user@m.gmane.org; Mon, 07 Nov 2011 01:19:47 +0100 Original-Received: from localhost ([::1]:59639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNCwE-00083D-4p for guile-user@m.gmane.org; Sun, 06 Nov 2011 19:19:46 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNCwA-00082G-DA for guile-user@gnu.org; Sun, 06 Nov 2011 19:19:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNCw9-0008NQ-IP for guile-user@gnu.org; Sun, 06 Nov 2011 19:19:42 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:47027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNCw9-0008NK-FD for guile-user@gnu.org; Sun, 06 Nov 2011 19:19:41 -0500 Original-Received: by vcbfo13 with SMTP id fo13so959647vcb.0 for ; Sun, 06 Nov 2011 16:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/8F9d2oM2YgBciV+mI5M3YHF/b4Ub/Q1c+8sFfMSjnQ=; b=k3k0FoQjg9tTZhnbG5/hHTs0f1O5AAVclku2x6wkMha6G7PApMhNdUvuspZhmys5iN vuIJNl1x6foS8GrNTckHIW/uaXG8+tIv4AWdcCKN2tHPiiDgFnFT3x8v5ym5ZUouFlxf 8KsGdA9fUUZPT8T7QqRXQJehMcOScJsqMKap4= Original-Received: by 10.220.8.195 with SMTP id i3mr1203987vci.209.1320625180767; Sun, 06 Nov 2011 16:19:40 -0800 (PST) Original-Received: by 10.220.162.3 with HTTP; Sun, 6 Nov 2011 16:19:40 -0800 (PST) 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:8936 Archived-At: When guile 2.0 is used to write scripts, one have to manually do a setlocale at the beginning of the script to enable non-asciiI character support (why not by default?). My question is that the command line arguments seems to be parsed before any code in the script is executed (including the setlocale). Thus non-ascii arguments are not read correctly. Do I miss something or can anybody tell me how to read arguments correctly? My locale is en_US.UTF-8. Guile 1.8 works just fine. $ cat test.scm #!/usr/bin/guile !# (setlocale LC_ALL "") (write (command-line)) $ ./test.scm =E8=B7=AA=E4=BA=86 ("./test.scm" "??????")