Is -C useless?
Paul LeoNerd Evans
leonerd at leonerd.org.uk
Fri Sep 12 00:59:30 BST 2008
On Fri, 12 Sep 2008 00:48:06 +0100
Paul LeoNerd Evans <leonerd at leonerd.org.uk> wrote:
> binmode STDOUT, ":utf8" if grep m/utf-?8/i, @ENV{qw(LANG LC_MESSAGES LC_ALL)};
>
> And even then I'm not sure it's right.
Actually it's still not... We have to take the first defined one, not try
our best to find one:
binmode STDOUT, ":utf8" if ( $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG} ) =~ m/utf-?8/i
which -technically- still breaks because we could have LC_ALL=0 in our
environment, but I think it's close enough.
> Which really just proves my point...
... even more.
--
Paul "LeoNerd" Evans
leonerd at leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://london.pm.org/pipermail/london.pm/attachments/20080912/a8749cb7/signature.pgp
More information about the london.pm
mailing list