def has_encoding(string_buffer, encoding):
    """
    Determines if the provided buffer is encoded in the provided encoding.

    :type string_buffer: String
    :param string_buffer: The string buffer.
    :type encoding: String
    :param encoding: The encoding against which to test the string buffer.
    """
    has_encoding = None
    try:
        string_buffer.decode(encoding)
        has_encoding = True
    except:
        has_encoding = False
    return has_encoding
