unicode strtoupper
@param mixed $txt
@param bool $cleanPhrase
@return string
977956
public static function toUpper($txt, bool $cleanPhrase = false): string
    {
        $txt = $cleanPhrase ? self::cleanPhrase($txt) : $txt;
        return mb_strtoupper($txt, self::ENCODING);
    }
475771
public static function getAlpha($txt, bool $convertPoint = false, bool $allowWhiteSpaces = false, string $regex = '/[^a-zA-Z0-9 ._+-]/'): string
    {
        $from = utf8_decode("ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüŸŶÿŷÑñ /" . ($convertPoint ? '.' : ''));
        $to = "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuYYyynn" . ($allowWhiteSpaces ? ' ' : '-') . "-" . ($convertPoint ? '-' : '');
        $txt = utf8_encode(strtr(utf8_decode($txt), $from, $to));
        return preg_replace($regex, '', $txt);
    }
151642
public static function strtolower($text, $charset='utf-8') {
        $charset = self::parse_charset($charset);

        if ($charset === 'utf-8' and function_exists('mb_strtolower')) {
            return mb_strtolower($text, 'UTF-8');
        }

        $oldlevel = error_reporting(E_PARSE);
        $result = self::typo3()->conv_case($charset, (string)$text, 'toLower');
        error_reporting($oldlevel);

        return $result;
    }
23740
public function getFromString($includeText = true)
    {
        $statement = "";

        if (!$this->from) {
            return $statement;
        }

        $statement .= $this->getFrom();

        if ($this->getFromAlias()) {
            $statement .= " AS " . $this->getFromAlias();
        }

        // Add any JOINs.
        $statement .= " " . $this->getJoinString();

        $statement = rtrim($statement);

        if ($includeText && $statement) {
            $statement = "FROM " . $statement;
        }

        return $statement;
    }
726921
protected function xmlEncode($txt)
    {
        $txt = str_replace('<', '&lt;', $txt);
        $txt = str_replace('>', '&gt;', $txt);
        $txt = str_replace('&amp;apos;', "'", $txt);
        $txt = str_replace('&amp;quot;', '"', $txt);

        return $txt;
    }
58931
function convert_text($text)
    {
        global $debug_object;
        if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}

        $converted_text = $text;

        $sourceCharset = "";
        $targetCharset = "";

        if ($this->dom)
        {
            $sourceCharset = strtoupper($this->dom->_charset);
            $targetCharset = strtoupper($this->dom->_target_charset);
        }
        if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}

        if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
        {
            // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
            if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text)))
            {
                $converted_text = $text;
            }
            else
            {
                $converted_text = @iconv($sourceCharset."//IGNORE", $targetCharset."//IGNORE", $text);
            }
        }

        // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
        if ($targetCharset == 'UTF-8')
        {
            if (substr($converted_text, 0, 3) == "\xef\xbb\xbf")
            {
                $converted_text = substr($converted_text, 3);
            }
            if (substr($converted_text, -3) == "\xef\xbb\xbf")
            {
                $converted_text = substr($converted_text, 0, -3);
            }
        }

        return $converted_text;
    }
437918
function convert($txt) {
		$txt=preg_replace_callback(
			'/(<code.*?>.+?<\/code>|'.
			'<[^>\n]+>|\([^\n\)]+\)|"[^"\n]+")|'.
			'\\\\(.)/s',
			function($expr) {
				// Process escaped characters
				return empty($expr[1])?$expr[2]:$expr[1];
			},
			$this->build(preg_replace('/\r\n|\r/',"\n",$txt))
		);
		return $this->snip($txt);
	}
1326969
function convertText( $text, $isHeader = false )
    {

        $charset = $this->contentCharset();
        if ( $this->isAllowedCharset( $charset ) )
            return $text;
        $outputCharset = $this->outputCharset();
        if ( !$this->TextCodec )
        {
            $this->TextCodec = eZTextCodec::instance( $charset, $outputCharset );
        }
        $newText = $this->TextCodec->convertString( $text );
        return $newText;
    }
256735
public static function strtoupper($text) {
    if (static::getStatus() == static::STATUS_MULTIBYTE) {
      return mb_strtoupper($text);
    }
    else {
      // Use C-locale for ASCII-only uppercase.
      $text = strtoupper($text);
      // Case flip Latin-1 accented letters.
      $text = preg_replace_callback('/\xC3[\xA0-\xB6\xB8-\xBE]/', '\Drupal\Component\Utility\Unicode::caseFlip', $text);
      return $text;
    }
  }
186785
public function clean_string($str)
    {
        if ($this->is_ascii($str) === FALSE) {
            if (MB_ENABLED) {
                $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8');
            } elseif (ICONV_ENABLED) {
                $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
            }
        }

        return $str;
    }
947832
public static function strToUpper($string)
    {
        $string = str_replace(self::$lowerTR, self::$upperTR, $string);

        return mb_strtoupper($string, 'UTF-8');
    }
168907
def text(self, clean=True):
        
        if clean:
            return utils.normalise_whitespace(''.join(self).replace('\n', ' '))
        else:
            return ''.join(self)
588530
public static function ucPhrase($str): string
    {
        $str = mb_strtolower(self::cleanPhrase($str), self::ENCODING);
        $names = explode(' ', $str);
        array_walk($names, 'self::ucFirstTouch');
        $names = explode('-', implode(' ', $names));
        array_walk($names, 'self::ucFirstTouch');
        return implode('-', $names);
    }
741815
function clean_string($str)
	{
		if ($this->_is_ascii($str) === FALSE)
		{
			$str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
		}

		return $str;
	}
695838
private static String cleanText(String strText) {
        strText = HTMLParser.unsafeRemoveAllTags(strText);
        strText = strText.toLowerCase(Locale.ENGLISH);
        
        strText = StringCleaner.unifyTerminators(strText);
        
        strText = strText.replaceAll(" [0-9]+ ", " "); // Remove "words" comprised only of numbers
        
        strText = StringCleaner.removeExtraSpaces(strText);
        return strText;
    }
763390
public function automatedReadabilityIndex($strText = false)
    {
        $strText = $this->setText($strText);

        $score = Maths::bcCalc(
            Maths::bcCalc(
                4.71,
                '*',
                Maths::bcCalc(
                    Text::letterCount($strText, $this->strEncoding),
                    '/',
                    Text::wordCount($strText, $this->strEncoding)
                )
            ),
            '+',
            Maths::bcCalc(
                Maths::bcCalc(
                    0.5,
                    '*',
                    Maths::bcCalc(
                        Text::wordCount($strText, $this->strEncoding),
                        '/',
                        Text::sentenceCount($strText, $this->strEncoding)
                    )
                ),
                '-',
                21.43
            )
        );

        if ($this->normalise) {
            return Maths::normaliseScore($score, 0, $this->maxGradeLevel, $this->dps);
        } else {
            return Maths::bcCalc($score, '+', 0, true, $this->dps);
        }
    }
581295
public static function strtolower($text) {
    if (static::getStatus() == static::STATUS_MULTIBYTE) {
      return mb_strtolower($text);
    }
    else {
      // Use C-locale for ASCII-only lowercase.
      $text = strtolower($text);
      // Case flip Latin-1 accented letters.
      $text = preg_replace_callback('/\xC3[\x80-\x96\x98-\x9E]/', '\Drupal\Component\Utility\Unicode::caseFlip', $text);
      return $text;
    }
  }