protected function _sanitize($value)
    {
        $value = strip_tags($value);
        // Preserve escaped octets.
        $value = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $value);
        // Remove percent signs that are not part of an octet.
        $value = str_replace('%', '', $value);
        // Restore octets.
        $value = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $value);

        if ($this->_utf8($value)) {
            if (function_exists('mb_strtolower')) {
                $value = mb_strtolower($value, 'UTF-8');
            }
            $value = $this->_utf8encode($value, $this->_slug_length);
        }

        $value = strtolower($value);
        $value = preg_replace('/&.+?;|[^%a-z0-9_-]/', '-', $value); // replace entities and non-alpahnum with dashes
        $value = preg_replace('|-+|', '-', $value);
        $value = trim($value, '-');

        return $value;
    }