Corrects the potential offset issue with some UTF-8 characters

@param $index
@return int
978105
protected function correctIndexOffset($index)
    {
        return mb_strlen(mb_substr($this->title, 0, $index, $this->encoding), $this->encoding);
    }
892125
public function offsetUnset ($index)
	{
		$value = $this->offsetGet($index);

		if ($index == 0) {
			return array_shift($this->storage);
		}

		if ($index == $this->count() - 1) {
			return array_pop($this->storage);
		}

		$new = $this->slice(0, $index - 1);
		$new->push($this->slice($index, $this->count()));

		$this->storage = $new->to_array();

		return $value;
	}
979729
private function elapsedTime( $index = 'utime')
	{
		if ( version_compare( PHP_VERSION, "7.0", "<" ) ) return;

		$rus = $this->rustart;
		$ru = getrusage();
		return ( $ru[ "ru_$index.tv_sec" ] * 1000 + intval( $ru[ "ru_$index.tv_usec" ] / 1000 ) ) - ( $rus[ "ru_$index.tv_sec" ] * 1000 + intval( $rus[ "ru_$index.tv_usec" ] / 1000 ) );
	}
527042
public function offsetExists( $index ) {
		if ( $this->deepSelectorOption ) {
			return \UArray::hasDeepSelector( $this->getArrayCopy( ), $index );
		}
		return parent::offsetExists( $index );
	}
357271
public function getAddIndexDDL(Index $index)
    {
        $pattern = "
CREATE %sINDEX %s ON %s (%s);
";

        return sprintf($pattern,
            $this->getIndexType($index),
            $this->quoteIdentifier($index->getName()),
            $this->quoteIdentifier($index->getTable()->getName()),
            $this->getIndexColumnListDDL($index)
        );
    }
910059
public function deleteCharAt($index)
	{
		$index = (int) $index;
		if ($index < 0 || $index >= $this->length()) {
			throw new OutOfBoundsException();
		}

		$this->string = mb_substr(
				$this->string,
				0,
				$index,
				$this->encoding
			) .
			mb_substr(
				$this->string,
				$index + 1,
				$this->length(),
				$this->encoding
			);
		return $this;
	}
1114397
function processDelimiter( $index = false )
    {
        if ( $this->Delimiter === null || $this->SkipDelimiter )
            return false;

        $delimiterChildren = $this->Delimiter[1];
        $delimiterParameters = $this->Delimiter[3]; // Get parameters
        $delimiterMatch = true;
        // Check for "modulo"
        if ( isset( $delimiterParameters["modulo"] ) and $index !== false )
        {
            $delimiterModulo = $delimiterParameters["modulo"];
            $modulo = $this->Tpl->elementValue( $delimiterModulo, $this->RootNamespace, $this->FunctionName, $this->FunctionPlacement );
            $modulo = trim( $modulo );
            if ( is_numeric( $modulo ) )
                $delimiterMatch = ( $index % $modulo ) == 0;
        }
        if ( $delimiterMatch )
        {
            foreach ( $delimiterChildren as $delimiterChild )
            {
                $this->Tpl->processNode( $delimiterChild, $this->TextElements, $this->RootNamespace, $this->CurrentNamespace );
            }
        }

        return false;
    }
473065
private function _parseAttrHexValue(int &$offset): string
    {
        $idx = $offset;
        $hexstr = $this->_regexMatch('/^(?:[0-9a-f]{2})+/i', $idx);
        if (null === $hexstr) {
            throw new \UnexpectedValueException("Invalid hexstring.");
        }
        $data = hex2bin($hexstr);
        $offset = $idx;
        return $data;
    }
426729
private function findPosition($index){
        if ($index < $this->total){
            $this->letter[] = $this->alphabet[$index];
        }
        else {
            $mod = $index % $this->total;
            $div = (int) $index / $this->total;
            $this->letter[] = $this->alphabet[$mod];
            $this->findPosition($div-1);
        }
    }
180273
protected function getLoadValueFromIndex($index)
    {
        $loadValue = $this->getLoadValue();
        if (!is_array($loadValue)) {
            $loadValue = [];
        }

        return array_get($loadValue, $index, []);
    }
291198
public function getColumnName($index){
        $this->letter = array();
        $this->findPosition($index);
        return join(array_reverse($this->letter), '');
    }
971824
public static function decimalToAlphanumeric($number, $base = 64, $index = false)
    {
        if (!$base) {
            $base = strlen($index);
        } elseif (!$index) {
            $index = substr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, $base);
        }

        $out = "";

        for ($i = floor(log10($number) / log10($base)); $i >= 0; $i--) { 
            $no = floor($num/pow($base, $i));
            $out = $out.substr($index, $no, 1);
            $number = $number - ($no * pow($base, $i));
        }
        return $out;
    }
1106879
public function offsetGet($offset)
    {
        switch ($offset) {
            case 'tag':
            case 'code': return $this->getTag();
            break;
            case 'indexStart':
                return $this->getIndexStart();
            break;
            case 'indexEnd':
                return $this->getIndexEnd();
            break;
            case 'indexLength':
                return $this->getIndexLength();
            break;
            case 'charStart':
                return $this->getCharStart();
            break;
            case 'charEnd':
                return $this->getCharEnd();
            break;
            case 'charLength':
                return $this->getCharLength();
            break;
            case 'subSpecs':
                return $this->getSubSpecs();
            break;
            default:
                return;
        }
    }
1228100
public function offsetGet($index)
    {
        if (!array_key_exists($index, $this->data)) {
            throw InvalidArgumentException::format(
                    'Invalid array object index: expecting one of (%s), %s given',
                    Debug::formatValues(array_keys($this->data)), is_string($index) ? "'{$index}'" : $index
            );
        }

        return $this->data[$index];
    }
525403
protected function getIndexSqlDefinition(Index $index)
    {
        $def = '';
        $limit = '';
        if ($index->getLimit()) {
            $limit = '(' . $index->getLimit() . ')';
        }

        if ($index->getType() == Index::UNIQUE) {
            $def .= ' UNIQUE';
        }

        if ($index->getType() == Index::FULLTEXT) {
            $def .= ' FULLTEXT';
        }

        $def .= ' KEY';

        if (is_string($index->getName())) {
            $def .= ' `' . $index->getName() . '`';
        }

        $def .= ' (`' . implode('`,`', $index->getColumns()) . '`' . $limit . ')';

        return $def;
    }
262759
public function offsetGet($index)
    {
        foreach ((array)$this as $i => $element) {
            $i = (string)$i;
            if (is_string($element)) {
                continue;
            }
            if ($element->getElement()->getValue() == $index) {
                return $element;
            }
        }
        return parent::offsetGet($index);
    }
886282
public function getCharAt(int $index): string
    {
        if (!isset($this->charsSet[$index])) {
            throw DictionaryException::indexOutOfBounds();
        }

        return $this->charsSet[$index];
    }