Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.4
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Locale
-
Labels:None
Description
Zend_Locale_Format::_parseDate assumes that iconv internal encoding is UTF-8 and performs operations against UTF-8 data from Zend_Locale. If the internal character encoding is something other than UTF-8, it fails.
The below patch fixes the failure, but isn't entirely complete; the function will still fail some of the iconv operations if $date is not a valid UTF-8 string. It should be converted to UTF-8 at the beginning of the function, but I don't have an idea on how best to accomplish this.
Patch:
--- Format.php (revision 16719)
+++ Format.php (working copy)
@@ -665,6 +667,9 @@
$number = $date; // working copy
$result['date_format'] = $format; // save the format used to normalize $number (convenience)
$result['locale'] = $options['locale']; // save the locale used to normalize $number (convenience)
+
+ $oldEncoding = iconv_get_encoding('internal_encoding');
+ iconv_set_encoding('internal_encoding', 'UTF-8');
$day = iconv_strpos($format, 'd');
$month = iconv_strpos($format, 'M');
@@ -925,6 +930,7 @@
}
}
+ iconv_set_encoding('internal_encoding', $oldEncoding);
return $result;
}
Issue Links
| This issue is duplicated by: | ||||
| ZF-8781 | 31.40. Converting numerals from Latin script to Eastern Arabic script won't work |
|
|
|
Fixed with r17783