def byte_string_valid_encoding(byte_string, encoding='utf-8'):
    """Detect if a byte :class:`bytes` is valid in a specific encoding

    :arg byte_string: Byte :class:`bytes` to test for bytes not valid in this
        encoding
    :kwarg encoding: encoding to test against.  Defaults to :term:`UTF-8`.
    :returns: :data:`True` if there are no invalid :term:`UTF-8` characters.
        :data:`False` if an invalid character is detected.

    .. note::

        This function checks whether the byte :class:`bytes` is valid in the
        specified encoding.  It **does not** detect whether the byte
        :class:`bytes` actually was encoded in that encoding.  If you want that
        sort of functionality, you probably want to use
        :func:`~kitchen.text.misc.guess_encoding` instead.
    """
    try:
        str(byte_string, encoding)
    except UnicodeError:
        return False
    return True
