def cql_encode_all_types(self, val, as_text_type=False):
        """
        Converts any type into a CQL string, defaulting to ``cql_encode_object``
        if :attr:`~Encoder.mapping` does not contain an entry for the type.
        """
        encoded = self.mapping.get(type(val), self.cql_encode_object)(val)
        if as_text_type and not isinstance(encoded, six.text_type):
            return encoded.decode('utf-8')
        return encoded