original_string: 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;
  	}
code: 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;
  	}
code_tokens: 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 ; }
docstring: Attempts to detect the encoding of the given string from the encodingList.
  
  @param string $str
  @param array $encodingList
  @return bool
docstring_tokens: Attempts to detect the encoding of the given string from the encodingList .