Subject: | Date::Manip does not work with russian language |
Date: | Wed, 05 Mar 2014 19:14:59 +0400 |
To: | bug-date-manip [...] rt.cpan.org |
From: | Никулин Юрий <ynikulin [...] yandex.ru> |
Distribution name and version: Date-Manip-6.43
perl version: v5.10.1 (probably all versions)
Operating System vendor and version: Linux nikulin*** 2.6.32-042stab084.25 #1 SMP Wed Feb 12 16:04:42 MSK 2014 x86_64 x86_64 x86_64 GNU/Linux (probably all OSes)
Date::Manip does not work with russian language. Example script
use strict;
use warnings;
use Date::Manip;
warn 'UTF8 start';
eval {
use utf8;
Date::Manip::Date_Init("Language=Russian", "DateFormat=non-US");
my $t = Date::Manip::ParseDate("сейчас");
warn $t;
};
warn $@ if $@;
warn 'UTF8 end';
warn 'no UTF8 start';
eval {
no utf8;
Date::Manip::Date_Init("Language=Russian", "DateFormat=non-US");
my $t = Date::Manip::ParseDate("сейчас");
warn $t;
};
warn $@ if $@;
warn 'no UTF8 end';
use warnings;
use Date::Manip;
warn 'UTF8 start';
eval {
use utf8;
Date::Manip::Date_Init("Language=Russian", "DateFormat=non-US");
my $t = Date::Manip::ParseDate("сейчас");
warn $t;
};
warn $@ if $@;
warn 'UTF8 end';
warn 'no UTF8 start';
eval {
no utf8;
Date::Manip::Date_Init("Language=Russian", "DateFormat=non-US");
my $t = Date::Manip::ParseDate("сейчас");
warn $t;
};
warn $@ if $@;
warn 'no UTF8 end';
script output:
UTF8 start at dm.pl line 6.
Wide character in subroutine entry at /usr/lib64/perl5/vendor_perl/Encode.pm line 195.
UTF8 end at dm.pl line 14.
no UTF8 start at dm.pl line 16.
Warning: something's wrong at dm.pl line 21.
no UTF8 end at dm.pl line 24.
Wide character in subroutine entry at /usr/lib64/perl5/vendor_perl/Encode.pm line 195.
UTF8 end at dm.pl line 14.
no UTF8 start at dm.pl line 16.
Warning: something's wrong at dm.pl line 21.
no UTF8 end at dm.pl line 24.
Additionaly t/date.parse.russian.t in package is incorrect. It contans questions signs instead of russian symbols!
$tests="
???????? ???????? ???? 1977 16:00:00
1977062716:00:00
04.12.1999
1999120400:00:00
2 ??? 2012
2012050200:00:00
2 ??? 2012
2012050200:00:00
???????? ???????? ???? 1977 16:00:00
1977062716:00:00
04.12.1999
1999120400:00:00
2 ??? 2012
2012050200:00:00
2 ??? 2012
2012050200:00:00
But this tests allways pass because there aren't => before test results.
--
Yuri Nikulin