Returns the string transliterated from UTF-8 to Latin.

@return TeamSpeak3_Helper_String
340353
public function transliterate()
  {
    $utf8_accents = array(
      "à" => "a",
      "ô" => "o",
      "ď" => "d",
      "ḟ" => "f",
      "ë" => "e",
      "š" => "s",
      "ơ" => "o",
      "ß" => "ss",
      "ă" => "a",
      "ř" => "r",
      "ț" => "t",
      "ň" => "n",
      "ā" => "a",
      "ķ" => "k",
      "ŝ" => "s",
      "ỳ" => "y",
      "ņ" => "n",
      "ĺ" => "l",
      "ħ" => "h",
      "ṗ" => "p",
      "ó" => "o",
      "ú" => "u",
      "ě" => "e",
      "é" => "e",
      "ç" => "c",
      "ẁ" => "w",
      "ċ" => "c",
      "õ" => "o",
      "ṡ" => "s",
      "ø" => "o",
      "ģ" => "g",
      "ŧ" => "t",
      "ș" => "s",
      "ė" => "e",
      "ĉ" => "c",
      "ś" => "s",
      "î" => "i",
      "ű" => "u",
      "ć" => "c",
      "ę" => "e",
      "ŵ" => "w",
      "ṫ" => "t",
      "ū" => "u",
      "č" => "c",
      "ö" => "oe",
      "è" => "e",
      "ŷ" => "y",
      "ą" => "a",
      "ł" => "l",
      "ų" => "u",
      "ů" => "u",
      "ş" => "s",
      "ğ" => "g",
      "ļ" => "l",
      "ƒ" => "f",
      "ž" => "z",
      "ẃ" => "w",
      "ḃ" => "b",
      "å" => "a",
      "ì" => "i",
      "ï" => "i",
      "ḋ" => "d",
      "ť" => "t",
      "ŗ" => "r",
      "ä" => "ae",
      "í" => "i",
      "ŕ" => "r",
      "ê" => "e",
      "ü" => "ue",
      "ò" => "o",
      "ē" => "e",
      "ñ" => "n",
      "ń" => "n",
      "ĥ" => "h",
      "ĝ" => "g",
      "đ" => "d",
      "ĵ" => "j",
      "ÿ" => "y",
      "ũ" => "u",
      "ŭ" => "u",
      "ư" => "u",
      "ţ" => "t",
      "ý" => "y",
      "ő" => "o",
      "â" => "a",
      "ľ" => "l",
      "ẅ" => "w",
      "ż" => "z",
      "ī" => "i",
      "ã" => "a",
      "ġ" => "g",
      "ṁ" => "m",
      "ō" => "o",
      "ĩ" => "i",
      "ù" => "u",
      "į" => "i",
      "ź" => "z",
      "á" => "a",
      "û" => "u",
      "þ" => "th",
      "ð" => "dh",
      "æ" => "ae",
      "µ" => "u",
      "ĕ" => "e",
      "œ" => "oe",
      "À" => "A",
      "Ô" => "O",
      "Ď" => "D",
      "Ḟ" => "F",
      "Ë" => "E",
      "Š" => "S",
      "Ơ" => "O",
      "Ă" => "A",
      "Ř" => "R",
      "Ț" => "T",
      "Ň" => "N",
      "Ā" => "A",
      "Ķ" => "K",
      "Ŝ" => "S",
      "Ỳ" => "Y",
      "Ņ" => "N",
      "Ĺ" => "L",
      "Ħ" => "H",
      "Ṗ" => "P",
      "Ó" => "O",
      "Ú" => "U",
      "Ě" => "E",
      "É" => "E",
      "Ç" => "C",
      "Ẁ" => "W",
      "Ċ" => "C",
      "Õ" => "O",
      "Ṡ" => "S",
      "Ø" => "O",
      "Ģ" => "G",
      "Ŧ" => "T",
      "Ș" => "S",
      "Ė" => "E",
      "Ĉ" => "C",
      "Ś" => "S",
      "Î" => "I",
      "Ű" => "U",
      "Ć" => "C",
      "Ę" => "E",
      "Ŵ" => "W",
      "Ṫ" => "T",
      "Ū" => "U",
      "Č" => "C",
      "Ö" => "Oe",
      "È" => "E",
      "Ŷ" => "Y",
      "Ą" => "A",
      "Ł" => "L",
      "Ų" => "U",
      "Ů" => "U",
      "Ş" => "S",
      "Ğ" => "G",
      "Ļ" => "L",
      "Ƒ" => "F",
      "Ž" => "Z",
      "Ẃ" => "W",
      "Ḃ" => "B",
      "Å" => "A",
      "Ì" => "I",
      "Ï" => "I",
      "Ḋ" => "D",
      "Ť" => "T",
      "Ŗ" => "R",
      "Ä" => "Ae",
      "Í" => "I",
      "Ŕ" => "R",
      "Ê" => "E",
      "Ü" => "Ue",
      "Ò" => "O",
      "Ē" => "E",
      "Ñ" => "N",
      "Ń" => "N",
      "Ĥ" => "H",
      "Ĝ" => "G",
      "Đ" => "D",
      "Ĵ" => "J",
      "Ÿ" => "Y",
      "Ũ" => "U",
      "Ŭ" => "U",
      "Ư" => "U",
      "Ţ" => "T",
      "Ý" => "Y",
      "Ő" => "O",
      "Â" => "A",
      "Ľ" => "L",
      "Ẅ" => "W",
      "Ż" => "Z",
      "Ī" => "I",
      "Ã" => "A",
      "Ġ" => "G",
      "Ṁ" => "M",
      "Ō" => "O",
      "Ĩ" => "I",
      "Ù" => "U",
      "Į" => "I",
      "Ź" => "Z",
      "Á" => "A",
      "Û" => "U",
      "Þ" => "Th",
      "Ð" => "Dh",
      "Æ" => "Ae",
      "Ĕ" => "E",
      "Œ" => "Oe",
    );

    return new self($this->toUtf8()->replace(array_keys($utf8_accents), array_values($utf8_accents)));
  }
584138
public function getCharset() {
		if (!isset($this->charset)) {
			$numOfMatches = preg_match('/charset\s*=([^;]*)/', $this->getHeader('Content-Type'), $matches);
			if ($numOfMatches) {
				$this->charset = trim($matches[1]);
			} else {
				$this->charset = '';
			}
		}
		return $this->charset;
	}
608227
public function getAsString(): string
    {
        $text = iconv(
            $this->source->getEncoding(),
            $this->getEncoding(),
            $this->source->getAsString()
        );
        if (false === $text) {
            throw new SourceException('iconv failed to convert source text');
        }

        return $text;
    }
1279928
public function getAdapterType()
  {
    if($this->adapter instanceof TeamSpeak3_Adapter_Abstract)
    {
      $string = TeamSpeak3_Helper_String::factory(get_class($this->adapter));

      return $string->substr($string->findLast("_"))->replace(array("_", " "), "")->toString();
    }

    return "Unknown";
  }
1254632
public function toNQuads()
    {
        $string = '"'.$this->encodeStringLitralForNQuads($this->getValue()).'"';

        if ($this->getLanguage() !== null) {
            $string .= '@'.$this->getLanguage();
        } elseif ($this->getDatatype() !== null) {
            $string .= '^^<'.$this->getDatatype().'>';
        }

        return $string;
    }
963561
public function clientLang()
	{
		if ( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) {

			$language = explode(',', preg_replace('/(;\s?q=[0-9\.]+)|\s/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE']))));
			return strtolower($language[0]);
		}

		return;
	}
37797
protected function _getContentTransferEncoding()
    {
        if ($this->transferEncoding) {
            return $this->transferEncoding;
        }

        $charset = strtoupper($this->charset);
        if (in_array($charset, $this->_charset8bit)) {
            return '8bit';
        }

        return '7bit';
    }
644661
public static function ascii()
    {
        if (!self::$ascii) {
            self::$ascii = new static();
            self::$ascii->lineVLChar = '|';
            self::$ascii->lineVCChar = '|';
            self::$ascii->lineVRChar = '|';
            self::$ascii->lineHTChar = '-';
            self::$ascii->lineHCChar = '-';
            self::$ascii->lineHBChar = '-';
            self::$ascii->cornerTLChar = '+';
            self::$ascii->cornerTRChar = '+';
            self::$ascii->cornerBLChar = '+';
            self::$ascii->cornerBRChar = '+';
            self::$ascii->crossingCChar = '+';
            self::$ascii->crossingLChar = '+';
            self::$ascii->crossingRChar = '+';
            self::$ascii->crossingTChar = '+';
            self::$ascii->crossingBChar = '+';
        }

        return clone self::$ascii;
    }
1011882
public static function get_charset()
    {
        if (self::$default_charset) {
            return self::$default_charset;
        }

        if ($charset = rcube::get_instance()->config->get('default_charset')) {
            return $charset;
        }

        return RCUBE_CHARSET;
    }
576697
protected function getName()
  {
    if($this->currObj instanceof Channel && $this->currObj->isSpacer())
    {
      return $this->currObj["channel_name"]->section("]", 1, 99)->toString();
    }
    elseif($this->currObj instanceof Client)
    {
      $before = array();
      $behind = array();

      foreach($this->currObj->memberOf() as $group)
      {
        if($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE)
        {
          $before[] = "[" . $group["name"] . "]";
        }
        elseif($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND)
        {
          $behind[] = "[" . $group["name"] . "]";
        }
      }

      return trim(implode("", $before) . " " . $this->currObj . " " . implode("", $behind));
    }

    return $this->currObj->toString();
  }
14471
public function asUTF8String(): Primitive\UTF8String
    {
        if (!$this->_element instanceof Primitive\UTF8String) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_UTF8_STRING));
        }
        return $this->_element;
    }
1053700
protected function getSpacerType()
  {
    $type = "";

    if(!$this->currObj instanceof Channel || !$this->currObj->isSpacer())
    {
      return "none";
    }

    switch($this->currObj->spacerGetType())
    {
      case (string) TeamSpeak3::SPACER_SOLIDLINE:
        $type .= "solidline";
        break;

      case (string) TeamSpeak3::SPACER_DASHLINE:
        $type .= "dashline";
        break;

      case (string) TeamSpeak3::SPACER_DASHDOTLINE:
        $type .= "dashdotline";
        break;

      case (string) TeamSpeak3::SPACER_DASHDOTDOTLINE:
        $type .= "dashdotdotline";
        break;

      case (string) TeamSpeak3::SPACER_DOTLINE:
        $type .= "dotline";
        break;

      default:
        $type .= "custom";
    }

    if($type == "custom")
    {
      switch($this->currObj->spacerGetAlign())
      {
        case TeamSpeak3::SPACER_ALIGN_REPEAT:
          $type .= "repeat";
          break;

        case TeamSpeak3::SPACER_ALIGN_CENTER:
          $type .= "center";
          break;

        case TeamSpeak3::SPACER_ALIGN_RIGHT:
          $type .= "right";
          break;

        default:
          $type .= "left";
      }
    }

    return $type;
  }
1332895
public function getColorfulText()
    {
        $output = "\033[1;31m--[ Agile Toolkit Exception ]---------------------------\n";
        $output .= get_class($this).": \033[47m".$this->getMessage()."\033[0;31m".
            ($this->getCode() ? ' [code: '.$this->getCode().']' : '');

        foreach ($this->params as $key => $val) {
            $key = str_pad($key, 19, ' ', STR_PAD_LEFT);
            $output .= "\n".$key.': '.$this->toString($val);
        }

        $output .= "\n\033[0mStack Trace: ";

        $in_atk = true;
        $escape_frame = false;

        foreach ($this->getMyTrace() as $call) {
            if (!isset($call['file'])) {
                $call['file'] = '';
            } elseif (
                $in_atk &&
                strpos($call['file'], '/data/src/') === false &&
                strpos($call['file'], '/core/src/') === false &&
                strpos($call['file'], '/dsql/src/') === false
            ) {
                $escape_frame = true;
                $in_atk = false;
            }

            $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);

            $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);

            $output .= "\n\033[0;34m".$file."\033[0m";
            $output .= ":\033[0;31m".$line."\033[0m";

            if (isset($call['object'])) {
                $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;
                $output .= " - \033[0;32m".$name."\033[0m";
            }

            $output .= " \033[0;32m";

            if (isset($call['class'])) {
                $output .= $call['class'].'::';
            }

            if ($escape_frame) {
                $output .= "\033[0,31m".$call['function'];
                $escape_frame = false;

                $args = [];
                foreach ($call['args'] as $arg) {
                    $args[] = $this->toString($arg);
                }

                $output .= "\n".str_repeat(' ', 20)."\033[0,31m(".implode(', ', $args);
            } else {
                $output .= "\033[0,33m".$call['function'].'(';
            }

            $output .= ')';
        }

        if ($p = $this->getPrevious()) {
            $output .= "\n\033[0mCaused by Previous Exception:\n";
            $output .= "\033[1;31m".get_class($p).': '.$p->getMessage()."\033[0;31m".
                ($p->getCode() ? ' [code: '.$p->getCode().']' : '');
        }

        // next print params

        $output .= "\n\033[1;31m--------------------------------------------------------\n";

        return $output."\033[0m";
    }
833695
public function getSignatureBaseString()
    {
        $parts = array(
            $this->getNormalizedHttpMethod(),
            $this->getNormalizedHttpUrl(),
            $this->getSignableParameters(),
        );
        
        $parts = OAuthUtil::urlencodeRfc3986($parts);
        
        return implode('&', $parts);
    }
1002853
public function getFormatEncodingOptions()
    {
        $options = [
            'utf-8',
            'us-ascii',
            'iso-8859-1',
            'iso-8859-2',
            'iso-8859-3',
            'iso-8859-4',
            'iso-8859-5',
            'iso-8859-6',
            'iso-8859-7',
            'iso-8859-8',
            'iso-8859-0',
            'iso-8859-10',
            'iso-8859-11',
            'iso-8859-13',
            'iso-8859-14',
            'iso-8859-15',
            'Windows-1251',
            'Windows-1252'
        ];

        $translated = array_map(function ($option) {
            return Lang::get('backend::lang.import_export.encodings.'.Str::slug($option, '_'));
        }, $options);

        return array_combine($options, $translated);
    }
1075830
private function transliterateGerman($s)
    {
        $table = array(
            //'ä' => 'ae', //messes up with slovak -> they have ä -> a
            'ë' => 'e',
            'ï' => 'i',
            'ö' => 'oe',
            'ü' => 'ue',
            'Ä' => 'Ae',
            'Ë' => 'E',
            'Ï' => 'I',
            'Ö' => 'Oe',
            'Ü' => 'Ue',
            'ß' => 'ss',
        );
        return strtr($s, $table);
    }
825640
public function getCharset()
    {
        if ($this->exists()) {
            $finfo = new \finfo(FILEINFO_MIME_ENCODING | FILEINFO_PRESERVE_ATIME);
            $mime = $finfo->file($this->getRealPath());
            return $mime;
        }
        return null;
    }