Simple function for use ucfirst with utf-8 encoded cyrylic text
<?php
public function capitalize_first($str) {
$line = iconv("UTF-8", "Windows-1251", $str); // convert to windows-1251
$line = ucfirst($line);
$line = iconv("Windows-1251", "UTF-8", $line); // convert back to utf-8
return $line;
}
?>