Issues

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

Fixed with r13159

r13674 is actually ZF-5563 related.