gets unicode for each character
@see http://www.randomchaos.com/documents/?source=php_and_unicode

@return array
965994
private static function utf8ToUnicode($str)
    {
        $unicode = array();
        $values = array();
        $lookingFor = 1;

        for ($i = 0; $i < strlen($str); $i++ ) {
            $thisValue = ord($str[$i]);

            if ($thisValue < 128) {
                $unicode[] = $thisValue;
            }
            else {
                if (count($values) == 0) {
                    $lookingFor = $thisValue < 224 ? 2 : 3;
                }

                $values[] = $thisValue;

                if (count($values) == $lookingFor) {
                    $number = $lookingFor == 3
                              ? (($values[0] % 16) * 4096) + (($values[1] % 64) * 64) + ($values[2] % 64)
                              : (($values[0] % 32) * 64) + ($values[1] % 64);

                    $unicode[] = $number;
                    $values = array();
                    $lookingFor = 1;
                }
            }
        }

        return $unicode;
    }
1258110
protected final Charset getCharset() {
    return mediaType == null || mediaType.getCharsetParameter() == null
        ? Charsets.ISO_8859_1
        : mediaType.getCharsetParameter();
  }
488078
public function getTextSettings()
    {
        $description = sprintf($this->_(
                "Use the %%-sign to search for zero or more random characters and an _ for a single random character."
                ));

        return array(
            'gaf_filter_text1' => array(
                'label'       => $this->_('Activity'),
                'description' => $description,
                'required'    => true,
                ),
            'gaf_filter_text2' => array(
                'label'       => $this->_('Procedure'),
                'description' => $description,
                ),
            'gaf_filter_text3' => array(
                'label'       => $this->_('But not when'),
                'description' => sprintf($this->_("But skip when this text is found - use %%-sign as well.")),
                ),
            );
    }
360927
public function toUnicode()
  {
    $h = ord($this->char{0});

    if($h <= 0x7F)
    {
      return $h;
    }
    else if($h < 0xC2)
    {
      return FALSE;
    }
    else if($h <= 0xDF)
    {
      return ($h & 0x1F) << 6 | (ord($this->char{1}) & 0x3F);
    }
    else if($h <= 0xEF)
    {
      return ($h & 0x0F) << 12 | (ord($this->char{1}) & 0x3F) << 6 | (ord($this->char{2}) & 0x3F);
    }
    else if($h <= 0xF4)
    {
      return ($h & 0x0F) << 18 | (ord($this->char{1}) & 0x3F) << 12 | (ord($this->char{2}) & 0x3F) << 6 | (ord($this->char{3}) & 0x3F);
    }
    else
    {
      return FALSE;
    }
  }
694542
protected function getCharacterFromArray()
    {
        $character = $this->characters[rand(0, count($this->characters) - 1)];

        if ($this->unique) {
            $this->removeFromArray($character);
        }

        return $character;
    }
724407
protected function getEscapedCharacters() : array
    {
        if (self::$escapedSpecialCharacters !== null) {
            return self::$escapedSpecialCharacters;
        }

        return self::$escapedSpecialCharacters = \array_values(self::$specialCharactersMapping);
    }
794730
private function _source_result_charset()
     {
        if( preg_match("/^utf/", $this->targetCharSet) ) {
           $rs = 1;
        }
        else if( preg_match("/^gb/", $this->targetCharSet) ) {
           $rs = 2;
        }
        else if( preg_match("/^big/", $this->targetCharSet) ) {
           $rs = 3;
        }
        else {
            $rs = 4;
        }
        return $rs;
     }
563570
private function getCharacter()
    {
        $character = [];
        $character_index = 0;
        $char_table = $this->_parser->find('h2', 0);
        if ($char_table->next_sibling()->tag == 'table') {
            $char_table = $char_table->next_sibling();
            while (true) {
                $char_name_area = $char_table->find('td', 1);

                $character[$character_index]['image'] = $this->getCharacterImage($char_table);
                $character[$character_index]['id'] = $this->getCharacterId($char_name_area);
                $character[$character_index]['name'] = $this->getCharacterName($char_name_area);
                $character[$character_index]['role'] = $this->getCharacterRole($char_name_area);

                // va name + role
                $char_va_area = $char_table->find('td', 2);
                if ($char_va_area) {
                    $character[$character_index]['va'] = $this->getVa($char_va_area);
                }

                $char_table = $char_table->next_sibling();
                if ($char_table->tag == 'br' || $char_table->tag == 'a' || $char_table->tag == 'h2' || $char_table->tag == 'div') {
                    break;
                }
                $character_index++;
            }
        }

        return $character;
    }
839854
public function getCharset()
    {
        if ($this->isSlave() && ! $this->charset) {
            return $this->_master->getCharset();
        }

        return $this->charset;
    }
426051
public function getCharset()
    {
        return (isset(Yii::$app->charset) ? Yii::$app->charset : null) ?: mb_internal_encoding();
    }
1353766
public Charset getCharset() {
    // RFC2616 3.7
    for (String type : this.request.headers().getAll("Content-Type")) {
      int idx = type.toUpperCase().indexOf("CHARSET=");
      if (idx > 1) {
        String charset = type.substring(idx+8);
        return Charset.forName(charset);
      }
    }
    return Charset.forName("UTF-8");
  }
597876
public static function get()
    {
        mt_srand((int) (microtime(true) * 1000));

        $b = md5(uniqid(mt_rand(), true), true);
        $b[6] = chr((ord($b[6]) & 0x0F) | 0x40);
        $b[8] = chr((ord($b[8]) & 0x3F) | 0x80);

        return implode('-', unpack('H8a/H4b/H4c/H4d/H12e', $b));
    }
670092
public function getDefaultCharacterSet()
    {
        $characterSet = $this->config->get('database.preferred_character_set');
        $characterSet = $this->normalizeCharacterSet($characterSet);

        return $characterSet;
    }
428834
protected function characterData() {
        if ($this->scanner->current() === false) {
            return false;
        }
        switch ($this->textMode) {
            case HTML5_Elements::TEXT_RAW:
                return $this->rawText();
            case HTML5_Elements::TEXT_RCDATA:
                return $this->rcdata();
            default:
                $tok = $this->scanner->current();
                if (strspn($tok, "<&")) {
                    return false;
                }
                return $this->text();
        }
    }
974993
public function getAcceptLanguages(): array
    {
        $ls = [];

        if ($value = $this->getLine('Accept-Language')) {
            if (\strpos($value, ';')) {
                [$value,] = \explode(';', $value, 2);
            }

            $value = \str_replace(' ', '', $value);
            $ls    = \explode(',', $value);
        }

        return $ls;
    }
261224
public static function getSupportedEncodings()
    {
        if (static::$encodings === null) {
            static::$encodings = array_map('strtoupper', mb_list_encodings());

            // FIXME: Converting € (UTF-8) to ISO-8859-16 gives a wrong result
            $indexIso885916 = array_search('ISO-8859-16', static::$encodings, true);
            if ($indexIso885916 !== false) {
                unset(static::$encodings[$indexIso885916]);
            }
        }

        return static::$encodings;
    }
1119181
public function getEncodings()
    {
        if (null !== $this->encodings) {
            return $this->encodings;
        }

        return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
    }