protected function isValidStringLength($value)
{
$minValue = $this->getMinValue();
$maxValue = $this->getMaxValue();
$valid = true;
$charset = $this->getCharset();
if ($charset === '') {
$app = $this->getApplication()->getGlobalization();
$charset = $app ? $app->getCharset() : null;
if (!$charset) {
$charset = 'UTF-8';
}
}
$length = iconv_strlen($value, $charset);
if ($minValue !== '') {
$valid = $valid && $this->isGreaterThan($length, intval($minValue));
}
if ($maxValue !== '') {
$valid = $valid && $this->isLessThan($length, intval($maxValue));
}
return $valid;
}