protected function _prepareTitle($sTitle, $blSkipTruncate = false, $iLang = false)
    {
        $sTitle = $this->encodeString($sTitle, true, $iLang);
        $sSep = self::$_sSeparator;
        if (!$sSep || ('/' == $sSep)) {
            $sSep = '_';
        }

        $sRegExp = '/[^A-Za-z0-9\/' . preg_quote(self::$_sPrefix, '/') . preg_quote($sSep, '/') . ']+/';
        $sTitle = preg_replace(["#/+#", $sRegExp, "# +#", "#(" . preg_quote($sSep, '/') . ")+#"], $sSep, $sTitle);

        $oStr = getStr();
        // smart truncate
        if (!$blSkipTruncate && $oStr->strlen($sTitle) > $this->_iIdLength) {
            $iFirstSpace = $oStr->strpos($sTitle, $sSep, $this->_iIdLength);
            if ($iFirstSpace !== false) {
                $sTitle = $oStr->substr($sTitle, 0, $iFirstSpace);
            }
        }

        $sTitle = trim($sTitle, $sSep);

        if (!$sTitle) {
            return self::$_sPrefix;
        }

        // cleaning
        return $sTitle;
    }