[PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 9 Jun 2016 19:35:12 +0000 (22:35 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:02 +0000 (16:22 -0700)
de/6c0d0f44a348a8c318ff795967dfb1e541d1fd [new file with mode: 0644]

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