Issues

ZF-5203: Zend_Date::WEEKDAY_NARROW destroys multibyte-characters

Issue Type: Bug Created: 2008-12-10T13:33:32.000+0000 Last Updated: 2009-01-17T11:31:18.000+0000 Status: Resolved Fix version(s): - 1.7.2 (23/Dec/08)

Reporter: David Aurelio (_david) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-5563

Attachments:

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.

<pre class="highlight"><?php
$date = new Zend_Date('2008-12-10');
echo $date->get(Zend_Date::WEEKDAY_NARROW, 'pl');


<pre class="highlight"><?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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts