public static function forStringAndEncodings(
        $string,
        $from_encoding,
        $to_encoding,
        $code = self::CODE_FOR_STRING_AND_ENCODING_INFO,
        Exception $previous = null
    ) {
        $message = self::DEFAULT_MESSAGE
            . sprintf(self::MESSAGE_EXTENSION_FOR_STRING_FORMAT, $string)
            . sprintf(self::MESSAGE_EXTENSION_FOR_ENCODING_INFO_FORMAT, $from_encoding, $to_encoding);

        return new static($message, $code, $previous);
    }