diff --git a/lib/Template/Plugin/Date.pm b/lib/Template/Plugin/Date.pm index f94c5d8a..27a54185 100644 --- a/lib/Template/Plugin/Date.pm +++ b/lib/Template/Plugin/Date.pm @@ -32,7 +32,7 @@ use constant HAS_SETLOCALE => $Config::Config{d_setlocale}; our $VERSION = '3.106'; our $FORMAT = '%H:%M:%S %d-%b-%Y'; # default strftime() format -our @LOCALE_SUFFIX = qw( .ISO8859-1 .ISO_8859-15 .US-ASCII .UTF-8 ); +our @LOCALE_SUFFIX = qw( .UTF-8 .ISO8859-1 .ISO_8859-15 .US-ASCII ); #------------------------------------------------------------------------ @@ -164,7 +164,7 @@ sub format { : undef; # some systems expect locales to have a particular suffix - for my $suffix ('', @LOCALE_SUFFIX) { + for my $suffix (@LOCALE_SUFFIX, '') { my $try_locale = $locale.$suffix; my $setlocale = HAS_SETLOCALE ? &POSIX::setlocale(&POSIX::LC_ALL, $try_locale) diff --git a/t/date.t b/t/date.t index 125b6cbd..119083c0 100644 --- a/t/date.t +++ b/t/date.t @@ -63,7 +63,7 @@ sub time_locale { : undef; # some systems expect locales to have a particular suffix - for my $suffix ('', @Template::Plugin::Date::LOCALE_SUFFIX) { + for my $suffix (@Template::Plugin::Date::LOCALE_SUFFIX, '') { my $try_locale = $locale.$suffix; my $setlocale = $Config{d_setlocale} ? &POSIX::setlocale(&POSIX::LC_ALL, $try_locale)