- my $locale = get_locale($opts{lang});
- my $charset = get_charset($opts{lang});
- setlocale ( LC_ALL, $locale )
- or do { debug( "couldn't set locale $locale, using default" ) if DEBUG;
- setlocale( LC_ALL, get_locale() )
- or do {
- debug( "couldn't set default locale either" ) if DEBUG;
- setlocale( LC_ALL, "C" );
- };
- };
- debug( "locale=$locale charset=$charset", 1 ) if DEBUG;
+ my $charset = "UTF-8";
+ my $cat = Packages::I18N::Locale->get_handle( $opts{lang}, "en" )
+ or die "get_handle failed for $opts{lang}";
+ $opts{cat} = $cat;