def ensure_ascii_string(value):
    """
    Convert the provided value to an ASCII string (no Unicode characters).
    """
    if isinstance(value, bytes):
        value = value.decode('ascii', 'backslashreplace')
    else:
        value = bytes(str(value), encoding='utf-8').decode(encoding='ascii',
            errors='backslashreplace')
    return value
