Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 83942
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: NIKOLAS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Plugin::Date and unicode flag
[% date.format(date.now, '%A, %e %B %Y', locale => 'ru_RU.UTF-8') %] -> Четверг, 14 Март 2013 because, posix module return not flagged string. Patch fir fix this: @@ -24,7 +24,7 @@ use warnings; use base 'Template::Plugin'; use POSIX (); - +use Encode qw/_utf8_on/; our $VERSION = 2.78; our $FORMAT = '%H:%M:%S %d-%b-%Y'; # default strftime() format our @LOCALE_SUFFIX = qw( .ISO8859-1 .ISO_8859-15 .US-ASCII .UTF-8 ); @@ -135,10 +135,16 @@ } } $datestr = &POSIX::strftime($format, @date); + if( $locale =~ /utf\-?8/i ){ + _utf8_on( $datestr ); + } &POSIX::setlocale(&POSIX::LC_ALL, $old_locale); } else { $datestr = &POSIX::strftime($format, @date); + if( &POSIX::setlocale(&POSIX::LC_ALL) =~ /utf\-?8/i ){ + _utf8_on( $datestr ); + } } return $datestr;
Ticket migrated to github as https://github.com/abw/Template2/issues/117