* [PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting
@ 2016-06-09 19:35 Tomi Ollila
2016-06-11 16:22 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Tomi Ollila @ 2016-06-09 19:35 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting
2016-06-09 19:35 [PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting Tomi Ollila
@ 2016-06-11 16:22 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2016-06-11 16:22 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
Tomi Ollila <tomi.ollila@iki.fi> writes:
> 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.
pushed to master. If something breaks, complain to Tomi ;)
d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-11 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-09 19:35 [PATCH] devel/man-to-mdwn.pl: portable locale environment variable setting Tomi Ollila
2016-06-11 16:22 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).