diff --git a/includes/kernel.php b/includes/kernel.php index 617e40d3..ff841743 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -9,6 +9,8 @@ if (file_exists('config/config.php')) else $AoWoWconf = []; +mb_internal_encoding('UTF-8'); + require_once 'includes/defines.php'; require_once 'includes/libs/DbSimple/Generic.php'; // Libraray: http://en.dklab.ru/lib/DbSimple (using variant: https://github.com/ivan1986/DbSimple/tree/master) require_once 'includes/utilities.php'; // miscâ„¢ data 'n func diff --git a/includes/utilities.php b/includes/utilities.php index 5b2b2370..2e46a10d 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -1100,21 +1100,21 @@ class Util // default ucFirst doesn't convert UTF-8 chars public static function ucFirst($str) { - $len = mb_strlen($str, 'UTF-8') - 1; - $first = mb_substr($str, 0, 1, 'UTF-8'); - $rest = mb_substr($str, 1, $len, 'UTF-8'); + $len = mb_strlen($str) - 1; + $first = mb_substr($str, 0, 1); + $rest = mb_substr($str, 1, $len); - return mb_strtoupper($first, 'UTF-8').$rest; + return mb_strtoupper($first).$rest; } public static function ucWords($str) { - return mb_convert_case($str, MB_CASE_TITLE, 'UTF-8'); + return mb_convert_case($str, MB_CASE_TITLE); } public static function lower($str) { - return mb_strtolower($str, 'UTF-8'); + return mb_strtolower($str); } // note: valid integer > 32bit are returned as float