1# 2# This test aims to detect (using CPAN Testers) platforms where the locale 3# encoding detection doesn't work. 4# 5 6use strict; 7use warnings; 8 9use Test::More tests => 3; 10 11use encoding (); 12use Encode qw<find_encoding>; 13 14my $locale_encoding = encoding::_get_locale_encoding; 15 16SKIP: { 17 defined $locale_encoding or skip 'no locale encoding found', 3; 18 19 is(ref $locale_encoding, '', '_get_locale_encoding returns a scalar value'); 20 21 my $enc = find_encoding($locale_encoding); 22 ok(defined $enc, 'encoding returned is supported') 23 or diag("Encoding: ", explain($locale_encoding)); 24 isa_ok($enc, 'Encode::Encoding'); 25 eval { note($locale_encoding, ' => ', $enc->name); }; 26} 27