Issues

ZF-9854: Encoding problems in the Zend_Filter_StringToLower

Description

If UTF-8 or other multibyte encoding used as default, for example set with mb_internal_encoding or config file, and encoding not specified explicitly then Zend_Filter_StringToLower works incorrectly. It uses strtolower instead of mb_strtolower:

public function filter($value) { if ($this->_encoding !== null) { return mb_strtolower((string) $value, $this->_encoding); }

    return strtolower((string) $value);
} 

The same behaviour in some other filter functions.

It fires then used filter-validators chains. filter (strtolower) destroys multibyte string and when this value passed to a validator, StringLength for example, it lead to error like this: iconv_strlen() [function.iconv-strlen]: Detected an incomplete multibyte character in input string

short workaround: always explicitly set encoding option for each filter instance.

Comments

Attached patch.

Reassigned component

This feature is not supported for now and therefor no bug. Changed from bug to improvement.

Implemented with r22790 Thank you for the patch