Hello from Japan.
At first, I'd like to say thank you for the DateTime::Local module and
its maintainers. This useful module helps me writing codes for I18N.
I think the month_name() method returns a string encoded in UTF-8.
However, it seems to be encoded in Latin-1 when locale => "fr".
This is an expected behavior?
my $fr = DateTime->now(locale=>"fr")->month_name; # août (Latin-1)
This returns a French word "août" encoded in Latin-1.
my $ja = DateTime->now(locale=>"ja")->month_name; # 8月 (UTF-8)
This returns a Japanese word "8月" encoded in UTF-8.
I couldn't found significant differences between DateTime/Locale/fr.pm
and ja.pm source codes for their encodes.
Some other locales return strings encoded in UTF-8 as well.
my $tr = DateTime->now(locale=>"tr")->month_name; # Ağustos (UTF-8)
my $zh = DateTime->now(locale=>"zh")->month_name; # 八月 (UTF-8)
my $el = DateTime->now(locale=>"el")->month_name; # Αυγούστου (UTF-8)
And also I tried the code below:
----
use DateTime;
foreach my $lang (qw( de el en es fr ja nl no pl pt sv tr vi )) {
my $fmt = DateTime::Locale->load($lang)->full_date_format();
my $date = DateTime->now(locale => $lang)->strftime($fmt);
my $line = "$lang : $date\n";
print $line;
}
----
PS) My environment is following:
Perl 5.8.6 (darwin)
DateTime 0.34
DateTime::Locale 0.22
--
Kawasaki Yusuke
http://www.kawa.net/