ZF-5203: Zend_Date::WEEKDAY_NARROW destroys multibyte-characters
Description
Zend_Date::get() uses substr() to return dates formatted as Zend_Date::WEEKDAY_NARROW, which obviously doesn't work with multibyte character sets (as long it has not been overloaded with mb_substr).
The following snippets should put out multibyte characters in UTF-8 contexts, but Zend_Date::get() returns a byte > 127 which is an invalid UTF-8 sequence and will get displayed as "�" in most environments.
<?php
$date = new Zend_Date('2008-12-10');
echo $date->get(Zend_Date::WEEKDAY_NARROW, 'pl');
<?php
$date = new Zend_Date('2008-12-11');
var_dump($date->get(Zend_Date::WEEKDAY_NARROW, 'cs'));
The issue can be fixed in Zend/Date.php:839
Comments
Posted by Thomas Weidner (thomas) on 2008-12-11T12:06:59.000+0000
Fixed with r13159
Posted by Alexander Veremyev (alexander) on 2009-01-17T11:31:18.000+0000
r13674 is actually ZF-5563 related.