On Thu, 11 Sep 2008 15:19:17 +0200 Paul Johnson <[EMAIL PROTECTED]> wrote:
> Which is just what you seem to have discovered ;-)
In that case, I might have to consider the following:
package utf8::LocaleAware;
my $converted = 0;
sub import
{
return if $converted;
$converted = 1;
return unless $ENV{LANG} =~ m/\.UTF-8/;
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
require Encode;
map { $_ = Encode::decode_utf8 $_ } @ARGV, values %ENV;
}
Then just begin every program with
#!/usr/bin/perl
use utf8::LocaleAware;
But.. you know.. Suuuuurely there must be _some_ way to make -C not
useless?
Hell, even this might work:
#!/usr/bin/perl
BEGIN { exec $^X, "-C", @ARGV unless ${^UNICODE} }
--
Paul "LeoNerd" Evans
[EMAIL PROTECTED]
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
signature.asc
Description: PGP signature
