Closed (fixed)
Project:
Date
Version:
5.x-2.x-dev
Component:
Date API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2008 at 11:51 UTC
Updated:
1 Jul 2008 at 15:16 UTC
in date_api.module (line 175) we have this:
function date_week_days_abbr($required = FALSE, $refresh = TRUE, $length = 3) {
if ($refresh || empty($weekdays)) {
$weekdays = array();
foreach (date_week_days($refresh) as $key => $day) {
$weekdays[$key] = substr($day, 0, $length);
}
}
$none = array('' => '');
return !$required ? $none + $weekdays : $weekdays;
}
This code should use mb_substr instead of substr because it is using utf8 strings.
For example, with a three lenght, 'Wednesday' and 'Saturday' in spanish are 'Miércoles' and 'Sábado', which will end in 'Mi�' and 'Sá' instead of 'Mié' and 'Sab'.
Comments
Comment #1
karens commentedActually, we should be using drupal_substr() instead, and I found a few more places where this is needed. Committing changes to this for both the D5 and D6 versions. Thanks!
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.