src/IMAP/Message.php
public function getEncoding($structure) {
        if (property_exists($structure, 'parameters')) {
            foreach ($structure->parameters as $parameter) {
                if (strtolower($parameter->attribute) == "charset") {
                    return EncodingAliases::get($parameter->value);
                }
            }
        }elseif (is_string($structure) === true){
            return mb_detect_encoding($structure);
        }

        return 'UTF-8';
    }
public function getEncoding($structure) {
        if (property_exists($structure, 'parameters')) {
            foreach ($structure->parameters as $parameter) {
                if (strtolower($parameter->attribute) == "charset") {
                    return EncodingAliases::get($parameter->value);
                }
            }
        }elseif (is_string($structure) === true){
            return mb_detect_encoding($structure);
        }

        return 'UTF-8';
    }
public function getEncoding ( $ structure ) { if ( property_exists ( $ structure , 'parameters' ) ) { foreach ( $ structure -> parameters as $ parameter ) { if ( strtolower ( $ parameter -> attribute ) == "charset" ) { return EncodingAliases :: get ( $ parameter -> value ) ; } } } elseif ( is_string ( $ structure ) === true ) { return mb_detect_encoding ( $ structure ) ; } return 'UTF-8' ; }
Get the encoding of a given abject

@param object|string $structure

@return string
Get the encoding of a given abject