static function CheckEncoding($text,$charset,$disallowed_char_sequencies = array()){
		if(is_array($text)){
			foreach($text as $_key => $_value){
				$_stat_key = self::CheckEncoding($_key,$charset,$disallowed_char_sequencies);
				$_stat_value = self::CheckEncoding($_value,$charset,$disallowed_char_sequencies);
				if(!$_stat_key || !$_stat_value){
					return false;
				}
			}
			return true;
		}

		settype($charset,"string");
		settype($disallowed_char_sequencies,"array");
		$charset = self::_GetCharsetByName($charset);
		$out = true;
		switch($charset){
			case "utf8":
				$out = self::_CheckEncodingUtf8($text);
				break;
			case "ascii":
				$out = self::_CheckEncodingAscii($text);
				break;
		}

		if($out && sizeof($disallowed_char_sequencies)>0){
			for($i=0;$i<sizeof($disallowed_char_sequencies);$i++){
				if(is_int(strpos($text,$disallowed_char_sequencies[$i]))){
					$out = false;
					break;
				}
			}
		}

		return $out;
	}
static function CheckEncoding($text,$charset,$disallowed_char_sequencies = array()){
		if(is_array($text)){
			foreach($text as $_key => $_value){
				$_stat_key = self::CheckEncoding($_key,$charset,$disallowed_char_sequencies);
				$_stat_value = self::CheckEncoding($_value,$charset,$disallowed_char_sequencies);
				if(!$_stat_key || !$_stat_value){
					return false;
				}
			}
			return true;
		}

		settype($charset,"string");
		settype($disallowed_char_sequencies,"array");
		$charset = self::_GetCharsetByName($charset);
		$out = true;
		switch($charset){
			case "utf8":
				$out = self::_CheckEncodingUtf8($text);
				break;
			case "ascii":
				$out = self::_CheckEncodingAscii($text);
				break;
		}

		if($out && sizeof($disallowed_char_sequencies)>0){
			for($i=0;$i<sizeof($disallowed_char_sequencies);$i++){
				if(is_int(strpos($text,$disallowed_char_sequencies[$i]))){
					$out = false;
					break;
				}
			}
		}

		return $out;
	}
static function CheckEncoding ( $ text , $ charset , $ disallowed_char_sequencies = array ( ) ) { if ( is_array ( $ text ) ) { foreach ( $ text as $ _key => $ _value ) { $ _stat_key = self :: CheckEncoding ( $ _key , $ charset , $ disallowed_char_sequencies ) ; $ _stat_value = self :: CheckEncoding ( $ _value , $ charset , $ disallowed_char_sequencies ) ; if ( ! $ _stat_key || ! $ _stat_value ) { return false ; } } return true ; } settype ( $ charset , "string" ) ; settype ( $ disallowed_char_sequencies , "array" ) ; $ charset = self :: _GetCharsetByName ( $ charset ) ; $ out = true ; switch ( $ charset ) { case "utf8" : $ out = self :: _CheckEncodingUtf8 ( $ text ) ; break ; case "ascii" : $ out = self :: _CheckEncodingAscii ( $ text ) ; break ; } if ( $ out && sizeof ( $ disallowed_char_sequencies ) > 0 ) { for ( $ i = 0 ; $ i < sizeof ( $ disallowed_char_sequencies ) ; $ i ++ ) { if ( is_int ( strpos ( $ text , $ disallowed_char_sequencies [ $ i ] ) ) ) { $ out = false ; break ; } } } return $ out ; }
Checks if input string is in given charset.

Method can distinguish some characters (or even whole sequencies) that can not appear in the string.
When they appear method returns false

```
self::CheckEncoding($text, "utf-8", array(".",";","{","}","HUSAK"));
```

@param string|array $text string or array of strings
@param string $charset
@param array $disallowed_char_sequencies		forbidden chars or strings
@return bool
- true -> text is in given charset
- false -> text is not in given charset or contains a character or sequence from array $disallowed_char_sequencies
Checks if input string is in given charset .