public function detect($str, $encodingList = ['UTF-8', 'CP1252'])
	{
		$charset = mb_detect_encoding($str, $encodingList);
		if ($charset === false)
		{
			// could not detect charset
			return false;
		}

		$this->from = $charset;
		return true;
	}
public function detect($str, $encodingList = ['UTF-8', 'CP1252'])
	{
		$charset = mb_detect_encoding($str, $encodingList);
		if ($charset === false)
		{
			// could not detect charset
			return false;
		}

		$this->from = $charset;
		return true;
	}
public function detect ( $ str , $ encodingList = [ 'UTF-8' , 'CP1252' ] ) { $ charset = mb_detect_encoding ( $ str , $ encodingList ) ; if ( $ charset === false ) { // could not detect charset return false ; } $ this -> from = $ charset ; return true ; }
Attempts to detect the encoding of the given string from the encodingList.

@param string $str
@param array $encodingList
@return bool
Attempts to detect the encoding of the given string from the encodingList .