Returns normalized encoding name from common aliases

@param  string   $encodingLabel
@return string
193030
protected static function normalizeEncoding($encodingLabel)
    {
        $encoding = strtoupper($encodingLabel);
        $encoding = preg_replace('/[^a-zA-Z0-9\s]/', '', $encoding);

        $equivalences = [
            'ISO88591'      => 'ISO-8859-1',
            'ISO8859'       => 'ISO-8859-1',
            'ISO'           => 'ISO-8859-1',
            'LATIN1'        => 'ISO-8859-1',
            'LATIN'         => 'ISO-8859-1',
            'UTF8'          => 'UTF-8',
            'UTF'           => 'UTF-8',
            'WIN1252'       => 'ISO-8859-1',
            'WINDOWS1252'   => 'ISO-8859-1'
        ];

        if (empty($equivalences[$encoding])) {
            return 'UTF-8';
        }

        return $equivalences[$encoding];
    }
630483
public function getName($languageCode = null)
    {
        if ($languageCode === null) {
            $languageCode = $this->initialLanguageCode;
        }

        return $this->names[$languageCode];
    }
462571
public function reverse($encoding = null)
    {
        $reversed = '';

        if (!$this->hasMbstring()) {
            $len = \strlen($this->string);
            for ($i = $len - 1; $i >= 0; --$i) {
                $reversed .= \substr($this->string, $i, 1);
            }
        } else {
            $encoding = $this->encoding($encoding);

            $len = \mb_strlen($this->string, $encoding);
            for ($i = $len - 1; $i >= 0; --$i) {
                $reversed .= \mb_substr($this->string, $i, 1, $encoding);
            }
        }

        $this->string = $reversed;
        return $this;
    }
65250
public static function getUnicodeEntities($text, $inCharset)
    {
        if ($inCharset != 'UTF-8') {
            if (extension_loaded('iconv')) {
                $text = iconv($inCharset, 'UTF-8//TRANSLIT', $text);
            }
            else {
                throw new PHPRtfLite_Exception('Iconv extension is not available! '
                                             . 'Activate this extension or use UTF-8 encoded texts!');
            }
        }
        $text = self::utf8ToUnicode($text);
        return self::unicodeToEntitiesPreservingAscii($text);
    }
1064663
function versionName( $lang = false )
    {
        if ( !$lang )
        {
            $lang = $this->initialLanguageCode();
        }

        if ( isset( $this->VersionNameCache[$lang] ) )
            return $this->VersionNameCache[$lang];

        $object = $this->attribute( 'contentobject' );
        if ( !$object )
        {
            $retValue = false;
            return $retValue;
        }

        $class = $object->attribute( 'content_class' );
        if ( !$class )
        {
            $retValue = false;
            return $retValue;
        }

        $this->VersionNameCache[$lang] = $class->contentObjectName( $object,
                                                                    $this->attribute( 'version' ),
                                                                    $lang );
        return $this->VersionNameCache[$lang];
    }
161684
public function get_label($data) {
        $operators      = $this->get_operators();
        $profilefields = $this->get_profile_fields();

        if (empty($profilefields)) {
            return '';
        }

        $profile  = $data['profile'];
        $operator = $data['operator'];
        $value    = $data['value'];

        if (!array_key_exists($profile, $profilefields)) {
            return '';
        }

        $a = new stdClass();
        $a->label    = $this->_label;
        $a->value    = $value;
        $a->profile  = $profilefields[$profile];
        $a->operator = $operators[$operator];

        switch($operator) {
            case 0: // Contains.
            case 1: // Doesn't contain.
            case 2: // Equal to.
            case 3: // Starts with.
            case 4: // Ends with.
                return get_string('profilelabel', 'filters', $a);
            case 5: // Empty.
            case 6: // Is not defined.
            case 7: // Is defined.
                return get_string('profilelabelnovalue', 'filters', $a);
        }
        return '';
    }
1358196
public function normalizeLink($url)
    {
        if( property_exists($this,'normalizeLink') && is_callable($this->normalizeLink)){
            $fn = $this->normalizeLink;
            return $fn($url);
        }
        $parsed = $this->mdurl->parse($url, true);

        if ($parsed->hostname) {
            // Encode hostnames in urls like:
            // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
            //
            // We don't encode unknown schemas, because it's likely that we encode
            // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
            //
            $is = false;
            foreach (self::RECODE_HOSTNAME_FOR as &$v) {
                if( ($is = $v === $parsed->protocol) ) break;
            }
            if (empty($parsed->protocol) || $is) {
                try {
                    $parsed->hostname = $this->punycode->toASCII($parsed->hostname);
                } catch (\Exception $e) { /**/ }
            }
        }

        return $this->mdurl->encode($this->mdurl->format($parsed));
    }
910600
public static function title($value, $encoding = null)
    {
        $options  = [];
        $encoding = $encoding ?: static::$encoding;

        if ($encoding) {
            $options['encoding'] = $encoding;
        }

        return StaticFilter::execute(
            static::camelCaseToUnderscore($value), Filter\UpperCaseWords::class, $options
        );
    }
424211
public function escapeIdentifier(string $identifier): string
    {
        if ($identifier === '') {
            throw new \InvalidArgumentException('Identifier cannot be blank');
        }

        $escaper = function ($identifier) { return '`' . str_replace('`', '``', $identifier) . '`'; };
        $qualifiedIdentifiers = array_map($escaper, explode('.', $identifier));
        return implode('.', $qualifiedIdentifiers);
    }
852366
static function columnNameToLabel($columnname)
    {
        $retstring = str_replace("_", " ", $columnname);
        if (!function_exists("mb_strtolower")) {
            $retstring = ucwords(strtolower($retstring));
        } else {
            $retstring = ucwords(mb_strtolower($retstring, ReporticoLocale::outputCharsetToPhpCharset(ReporticoApp::getConfig("output_encoding"))));
        }

        return $retstring;
    }
635585
public function getSignatureBaseString() {
		$parts = [
			$this->getNormalizedMethod(),
			$this->getNormalizedUrl(),
			$this->getSignableParameters()
		];

		$parts = Util::urlencode( $parts );

		return implode( '&', $parts );
	}
886379
protected function _normalizeClass($name)
    {
        if (!$name || $name[0] === '\\') {
            return $name;
        }
        if ($this->_states['uses']) {
            $tokens = explode('\\', $name, 2);
            if (isset($this->_states['uses'][$tokens[0]])) {
                $prefix = $this->_states['uses'][$tokens[0]];
                return count($tokens) === 2 ? '\\' . $prefix . '\\' . $tokens[1] : '\\' . $prefix;
            }
        }
        $current = $this->_states['current'];
        $prefix = '\\';
        if ($current->namespace) {
            $prefix .= $current->namespace->name . '\\';
        }
        return $prefix . $name;
    }
441665
protected function getEntityAlias()
    {
        $entityName = $this->getRepository()->getClassName();
        if (false !== strpos($entityName, '\\')) {
            $entityName = substr(
                $entityName,
                strrpos($entityName, '\\') + 1
            );
        }

        $matches = array();
        preg_match_all(
            '/[A-Z]/',
            $entityName,
            $matches
        );
        return strtolower(implode('', $matches[0]));
    }
1063356
public static function labels($q)
    {
        $e = explode('.', $q);
        $r = '';
        for ($i = 0, $s = sizeof($e); $i < $s; ++$i) {
            $r .= chr(mb_orig_strlen($e[$i])) . $e[$i];
        }
        if (mb_orig_substr($r, -1) !== "\x00") {
            $r .= "\x00";
        }
        return $r;
    }
272100
private function getNormalizedCharset($charset)
    {
        $upper = null;
        if (is_array($charset)) {
            $upper = array_map('strtoupper', $charset);
        } else {
            $upper = strtoupper($charset);
        }
        return preg_replace('/[^A-Z0-9]+/', '', $upper);
    }
692598
static function fr_entities_encode($s)
	{
		//$s = str_replace("&", "&amp;", $s);
		$s = str_replace("é", "&eacute;", $s);
		$s = str_replace("è", "&egrave;", $s);
		$s = str_replace("ë", "&euml;", $s);
		$s = str_replace("ê", "&ecirc;", $s);
		$s = str_replace("à", "&agrave;", $s);
		$s = str_replace("ä", "&auml;", $s);
		$s = str_replace("â", "&acirc;", $s);
		$s = str_replace("ï", "&iuml;", $s);
		$s = str_replace("î", "&icirc;", $s);
		$s = str_replace("ö", "&ouml;", $s);
		$s = str_replace("ô", "&ocirc;", $s);
		$s = str_replace("ü", "&uuml;", $s);
		$s = str_replace("û", "&ucirc;", $s);
		$s = str_replace("ù", "&ugrave;", $s);
		$s = str_replace("ç", "&ccedil;", $s);
		$s = str_replace("€", "&euro;", $s);
	
		$s = str_replace("É", "&Eacute;", $s);
		$s = str_replace("È", "&Egrave;", $s);
		$s = str_replace("Ë", "&Euml;", $s);
		$s = str_replace("Ê", "&Ecirc;", $s);
		$s = str_replace("À", "&Agrave;", $s);
		$s = str_replace("Ä", "&Auml;", $s);
		$s = str_replace("Â", "&Acirc;", $s);
		$s = str_replace("Ï", "&Iuml;", $s);
		$s = str_replace("Î", "&Icirc;", $s);
		$s = str_replace("Ö", "&Ouml;", $s);
		$s = str_replace("Ô", "&Ocirc;", $s);
		$s = str_replace("Ü", "&Uuml;", $s);
		$s = str_replace("Û", "&Ucirc;", $s);
		$s = str_replace("Ù", "&Ugrave;", $s);
		$s = str_replace("Ç", "&Ccedil;", $s);
		
		return $s;
	}
788890
public function getLabel($item): string
    {
        /** @var ProductVariant $variant */
        $variant = $item->getVariant();
        $itemIdentifier = $variant->getCode() ? $this->default . ' - ' . $variant->getCode() : $this->default;

        return $itemIdentifier;
    }