from typing import Dict
from typing import Any
import json


def json_binary_dump(doc: Dict[str, Any]) -> bytes:
    """Dump the document as a JSON format, encoded in UTF-8."""
    return json.dumps(doc).encode('utf-8', 'replace')