[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command line argument locale for a guile script
From: |
cong gu |
Subject: |
Re: command line argument locale for a guile script |
Date: |
Mon, 7 Nov 2011 09:31:49 -0600 |
On Mon, Nov 7, 2011 at 6:59 AM, David Pirotte <address@hidden> 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 "跪了") ;; 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?