def METHOD_NAME():
    data = {"key1": "item1", "key2": [1, 2, "item2"], "key3": 45, 45: str}
    new_data = win_event._to_bytes(data, "CP1252", True)
    assert b"key1" in new_data
    assert b"key2" in new_data
    assert b"key3" in new_data
    assert new_data["key1".encode("CP1252")] == "item1".encode("CP1252")
    assert new_data["key2".encode("CP1252")][2] == "item2".encode("CP1252")