encoding example

/** * Change a string from one encoding to another * * @param string $data Raw data in $input encoding * @param string $input Encoding of $data * @param string $output Encoding you want * @return string|boolean False if we can't convert it */
    public static function change_encoding($data$input$output)
    {
        $input = SimplePie_Misc::encoding($input);
        $output = SimplePie_Misc::encoding($output);

        // We fail to fail on non US-ASCII bytes         if ($input === 'US-ASCII')
        {
            static $non_ascii_octects = '';
            if (!$non_ascii_octects)
            {
                for ($i = 0x80; $i <= 0xFF; $i++)
                {
                    $non_ascii_octects .= chr($i);
                }
$this->negotiator = Services::negotiator($this, true);
        }

        switch (strtolower($type)) {
            case 'media':
                return $this->negotiator->media($supported$strictMatch);

            case 'charset':
                return $this->negotiator->charset($supported);

            case 'encoding':
                return $this->negotiator->encoding($supported);

            case 'language':
                return $this->negotiator->language($supported);
        }

        throw HTTPException::forInvalidNegotiationType($type);
    }

    /** * Checks this request type. * * @param string $type HTTP verb or 'json' or 'ajax' * @phpstan-param string|'get'|'post'|'put'|'delete'|'head'|'patch'|'options'|'json'|'ajax' $type */
Home | Imprint | This part of the site doesn't use cookies.