Get default encoding from locale

This commit is contained in:
Peter J. Holzer 2017-02-17 13:19:17 +01:00
parent be21bc6ff8
commit 51abe1d11a
1 changed files with 5 additions and 3 deletions

View File

@ -1,11 +1,13 @@
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use Pod::Usage;
use autodie;
my $encoding;
use Getopt::Long;
use I18N::Langinfo qw(langinfo CODESET);
use Pod::Usage;
my $encoding = langinfo(CODESET);
GetOptions('encoding=s', \$encoding) or pod2usage();