Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9F5FA6DE01C2 for ; Thu, 9 Jun 2016 12:35:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.241 X-Spam-Level: X-Spam-Status: No, score=0.241 tagged_above=-999 required=5 tests=[AWL=0.250, HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LlgtRJ5M5yLS for ; Thu, 9 Jun 2016 12:35:32 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id BC8566DE01BE for ; Thu, 9 Jun 2016 12:35:31 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 84EDC1001E5; Thu, 9 Jun 2016 22:35:13 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting Date: Thu, 9 Jun 2016 22:35:12 +0300 Message-Id: <1465500912-25678-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.8.2 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 19:35:39 -0000 Setting locale environment variables (LC_* and LANG) to e.g. en_US.utf8 works fine on Linux, and that is what locale -a returns (in Linux). However this does not work e.g. in some *BSD systems. In these systems, en_US.UTF-8 works. This also works in Linux systems (which may look like a surprising thing on the first sight(*)). But that *UTF-8 format seems to be widely used in the Linux system: Grep it through the files in /etc/, for example. Easy way to test: Run the following command lines. First should complain about setting locale failed, and second should not. $ LC_ALL=en_US.UTF-1 perl -e '' $ LC_ALL=en_US.UTF-8 perl -e '' (*) and who knows what the "standard" is... --- devel/man-to-mdwn.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/man-to-mdwn.pl b/devel/man-to-mdwn.pl index f9d31b73a237..a3c40695c4ea 100755 --- a/devel/man-to-mdwn.pl +++ b/devel/man-to-mdwn.pl @@ -66,7 +66,7 @@ while (my ($k, $v) = each %fhash) my @lines; open I, '-|', qw/env -i/, "PATH=$ENV{PATH}", - qw/TERM=vt100 LANG=en_US.utf8 LC_ALL=en_US.utf8/, + qw/TERM=vt100 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8/, qw/GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 MANWIDTH=80/, qw/man/, $v or die "$!"; binmode I, ':utf8'; -- 2.8.2